Get KoolPHP UI with 30% OFF!

Time dependent values

Jayme
Hello,
I have six different value sources that can be grouped into two chart types I would like to use the Area Chart for the first group and a Column Chart for the other group, but both groups are composed by values pairs {X,Y} where the Y value is an integer or a float value and the X value is a given time when the Y value has occoured.
Both graphs should be updated when the user presses a refresh button.
The DateTime value and the values themselves are obtained from a database query. The DateTime values do not have a constant interval between them.
May I use the Chart Types I am interested in ? How can I do that ? I have only saw samples were the values were distributed within the graph width.
Thank you very much.
Posted Jan 19, 2017 , edited Jan 19, 2017 Kool -
Anthony Amolochitis
I use multiple charts on one page and they work fine. Some use timestamps as well.
Posted Jan 20, 2017 Kool
Jayme
Thank you very much for answering me.
So, how do you add a value pair as x= 2017-01-20 14:15:00 y= 20000 ? And after the next pair is { 2017-01-20 15:05:00, 30000 } and the next is { 2017-01-20 17:25:00, 40000 } ?
Be aware that the interval between values are not the same, and I would like them to show that difference
Best regards
Posted Jan 20, 2017 Kool
Anthony Amolochitis
Since your intervals are not the same, you should consider binning your data values so that you can create a readable chart if your data set is large.
Otherwise, the documentation on the site provides the how to on building your charts.
Demo site :
http://demo.koolphp.net/Examples/KoolChart/index.php
Documentation site :
http://doc.koolphp.net/Controls/KoolChart/index.php
Posted Jan 20, 2017 Kool
Jayme
So I am afraid this chart component do not fill my requirements.
I do not have any rule which I can use to make values at a constant interval. They are time and energy acquired from an energy meter.
I will try TeeChart for PHP from Steema.
Best regards.
Posted Jan 20, 2017 , edited Jan 20, 2017 Kool
Jayme
Hi Anthony,
So you have a good experience with KoolChart. Is there a way of adding value pairs of {XValue, YValue} or should I mount an array of pairs to pass to the Series object ?
Posted Feb 24, 2017 Kool
Anthony Amolochitis
I build the array of pairs first, and then input it into the series.
It works great!
Posted Feb 24, 2017 Kool
Jayme
Thank you very much.
I will try to build a Chart as I need.
Best regards
Posted Feb 24, 2017 Kool
Jayme
Hello Anthony,
Is there any way of creating a chart, render it and add data after that ?
Best regards.
Jayme Jeffman
Posted Apr 3, 2017 Kool
Anthony Amolochitis
I am assuming you are trying to cause the chart to update via ajax.
I'm not really too sure about that. I don't see any examples of it, but I am betting that you can put it inside an update panel like some of the koolajax examples and regenerate it.
I just do a full page refresh to get the current reporting data.
You may need to create a support ticket for this. If you figure it out, put a code example on the forum to explain how to do this if you don't mind. I'd like to know to do it as well out of curiousity.
Posted Apr 3, 2017 Kool
Jayme
Thank you very much.
I have already created the ticket.
What I really would like to do is to create the whole chart and its series using an external PHP script and pasting the result to the innerHTML of a div for example.
Best regards.
Posted Apr 3, 2017 Kool -
Jayme
So, I have taken the KoolChart Line Chart example and built it in an external script and attempted to assign the HTML code generated by the KoolChar::Render method to the innerHTML property of an HTM div element, it does nor work out.
I think there are some instructions which should be executed on the page load event.
I am afraid that building the chart in the main page could cause a showing delay because of time needed to retrieve the data from the database.
Best regards
Posted Apr 3, 2017 Kool