Charting library for Go ?

polaris · · 967 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hi <a href="/r/golang">/r/golang</a>!</p> <p>Once again, I would like your help!</p> <p>I am collecting some data (a value each day) and I would like to plot it. </p> <p>Simple, huh?</p> <p>I would like some simple things: integer values on the y axis, dates on the x axis, possibly 65-70° rotated (for readibility). Linespoint.</p> <p>So I&#39;ve spent the night playing with plotinum (<a href="https://code.google.com/p/plotinum/">https://code.google.com/p/plotinum/</a>) and gonum/plot (<a href="https://github.com/gonum/plot">https://github.com/gonum/plot</a>).</p> <p>RANT</p> <p>plotinum was fairly simple but just for very very very simple plots. It worked very well though. Until I deployed it. Then it exploded. I am deploying to Dokku, a self-hosted Heroku-like platform. Apparently plotinum installs its own fonts, that don&#39;t get installed in production for some reasons. Go figure.</p> <p>gonum/plot was supposed to be a rewriting and improvement of plotinum. Just doesn&#39;t work. Even examples do not work.</p> <p>/RANT</p> <p>So... What is your advice?</p> <hr/>**评论:**<br/><br/>GoGoGadgetGopher: <pre><p>i looked at Go charting stuff a while ago and came away similarly depressed.</p> <p>decided instead to use javascript on the frontend to generate the plot. now Go just generates a little javascript code. Check this out:</p> <p><a href="http://www.jsgraphs.com/">http://www.jsgraphs.com/</a></p></pre>excited_by_typos: <pre><p>+1, there are many good JS libraries out there for this. d3 is great for low level control if you need something really specific.</p></pre>BraveNewCurrency: <pre><p>+1. If you have a web app, images are worse than JS Graphs. PNGs require an extra round-trip + more bandwidth compared to JS. (You don&#39;t notice that when you develop locally, but it&#39;s the biggest factor in the real world.) JS graphs also makes you think about interactivity, which is often a killer feature. (Zooming, the ability to turn different bits on and off).</p> <p>There are plenty of libraries out there. I have used flot and d3, both are good. The only disadvantage is that you write more JS code. But there is always gopherjs. :)</p></pre>znpy: <pre><p>My idea was to have generate the image and save it in memory after the first query and after update of original data, in order to achieve near-static-like performances.</p> <p>Still, this is interesting, even though this is not what I was looking for.</p></pre>Spirit_of_Stallman: <pre><p>Hello. Look at this <a href="https://github.com/vdobler/chart">chart</a> package. </p></pre>captncraig: <pre><p>I&#39;ve used this a bit, and it generally works well.</p></pre>znpy: <pre><p>This looks promising!</p></pre>hargettp: <pre><p>Yes, thumbs up for that package: i used it last year to graph a bunch of metrics for one of our internal servers. Very easy, clean, and reliable to use; graphs were attractive, too.</p></pre>drvd: <pre><p>gonum/plot is under development, I hope it will change and be much fancier and more reliable in the future. chart should fulfill most of your requirements but it is ugly.</p></pre>gr0ch1: <pre><p>I also expose the data and do the charts in Javascript. JSGraphs is great, highcharts is also nice: interactive graphs which you&#39;d never get if you chart it server side. Plus you can keep them up to date by publishing new data eg on a websocket.</p></pre>howeman: <pre><p>Sorry for the examples not working. I believe they have been updated. <a href="https://github.com/gonum/plot/issues/212" rel="nofollow">https://github.com/gonum/plot/issues/212</a></p> <p>We would like a better solution to the font issue. I believe the problem is that we are unable to distribute the fonts as they are not under BSD. See <a href="https://github.com/gonum/plot/issues/107" rel="nofollow">https://github.com/gonum/plot/issues/107</a> and related discussion.</p></pre>bonekeeper: <pre><p>You can use d3 for web graphs. If you need static graphs you can use gnuplot to generate them.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

967 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传