Frank-Shanghai / PencilCase

0 stars 0 forks source link

Spike - JQuery Mobile chart #44

Closed Frank-Shanghai closed 6 years ago

Frank-Shanghai commented 6 years ago

Find a way to display data with chart. Prepare for the PBI: Data Analyse.

Frank-Shanghai commented 6 years ago

http://therockncoder.blogspot.com/2012/05/jquery-mobile-charts.html 比较老,里面使用jqplot,这个是2012年的,好像很久也没有更新过了。 jqplot http://www.jqplot.com/index.php

https://www.quora.com/What-is-the-best-chart-js-to-use-for-jQuery-Mobile-with-click-functions-and-I-am-using-only-Jquery-Mobile-and-Javascript-no-other-frame-work

https://1stwebdesigner.com/chart-js-library/ 上面这篇2017年的文章,里面使用chart.js。感觉chart.js不错。而且free。 github: https://github.com/chartjs/Chart.js 看来一直在更新,直至2018仍有fix home: http://www.chartjs.org/ samples: http://www.chartjs.org/samples/latest/ doc: http://www.chartjs.org/docs/latest/

stackoverflow中也有人在用: https://stackoverflow.com/questions/26528924/jquery-mobile-chartjs-responsive-bar-chart-displayed-only-after-resizing

Frank-Shanghai commented 6 years ago

另外有一个CanvasJS比较不错,但不是free的。 https://canvasjs.com/

Frank-Shanghai commented 6 years ago

颜色的自动分配问题。比如饼图,必须手动指定每条数据的颜色值。 好像1.x的时候,是支持颜色的自动分配的,如果不手动指定的话。 从2.0开始,把这一功能去掉了。 https://github.com/chartjs/Chart.js/issues/3130 https://stackoverflow.com/questions/39871319/automatic-colors-assignment-in-chart-js-2-x-doesnt-work-anymore-used-to-work-i https://jsfiddle.net/2y3o0nkx/

上面一个Link中有solution, 使用第三方的类库palette.js自动分配颜色。从而解决动态数据指定颜色的问题。