jQuery UI Widgets › Forums › Chart › Help possibility to do that
Tagged: chart, javascript chart, jquery chart, jqwidgets chart
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 6 years, 4 months ago.
-
Author
-
Hi,
I managed to make this graph
with a litle database like this one…
and the associated program
var source = { datatype: "json", datafields: [ { name: 'TRTSTARTDATC' }, { name: 'INDEX1' }, { name: 'INDEX2' } ], localdata: resu }; var dataAdapter = new $.jqx.dataAdapter(source); var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var settings = { title: "Line serie with missing points", description: 'Sample line serie with missing and invalid values', showLegend: true, enableAnimations: true, padding: { left: 5, top: 1, right: 15, bottom: 5 }, titlePadding: { left: 0, top: 0, right: 0, bottom: 10 }, source: dataAdapter, xAxis: { dataField: 'TRTSTARTDATC', formatFunction: function (value) { return value.getDate() + '-' + months[value.getMonth()] + '-' + value.getFullYear(); }, type: 'date', baseUnit: 'month', valuesOnTicks: true, minValue: '01-01-2014', maxValue: '01-06-2018', }, valueAxis: { unitInterval: 1, minValue: 0, maxValue: 30, labels: {horizontalAlignment: 'right'}, title: { text: 'MEDICNB' } }, colorScheme: 'scheme05', seriesGroups: [ { type: 'line', series: [ { dataField: 'INDEX1', emptyPointsDisplay: 'skip', displayText: 'AAA', lineWidth: 2, symbolSize: 8, symbolType: 'circle' } ] }, { type: 'line', series: [ { dataField: 'INDEX2', emptyPointsDisplay: 'skip', displayText: 'BBB', lineWidth: 2, symbolSize: 8, symbolType: 'circle' } ] } ] }; // create the chart $("#output").jqxChart(settings);
But this forcedme to create a series by drug(MEDICNB variable) that I have in my base… I would like that every addition of data in my base (new drug) The graph adds the new line without having to modify the code… Is that possible? Is there a way to present the database or program the JS to achieve this task?
Thanks
Nicolas;Hello Nicolas,
I would like to suggest you look at this forum topic, there has a similar discussion:
https://www.jqwidgets.com/community/topic/changing-data-series/#post-28299
You could use this approach to add new series in your scenario.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.