I need help understanding how can I render the plotting of a Chart in Vision ( I am using ignition platform 8.1.43 and vision module 11.1.43).
I make a tag history query, between two dates, (start date binding and end date binding). This fill the chart dataset .
When the interval is only 1 day, it fill X Axis chart in hours. Then if I change it to several days, it fill x-axis in hour too, but in this case i want to change this to days, not hours.
Is this the EasyChart or the Classic Chart? The EasyChart does its own history queries for all pens based on the resolution you configure (or bind) on the component.
The Classic Chart expects you to supply whatever history binding and/or custom computed datasets you wish, and simply plots that information.
Thank you for the answer. Sure, let me go deeper with the information.
I am using the classic chart, and I am filling its dataset throuhg an query tag history, with a fixed sample size.
I am selecting date intervals that can go from one day to thirty days. If I select one day, chart fills x-Axis in hours.
I need to set the scale of the x-Axis chart previous it is rendered, and I don't understand
if "Vision - Chart Scripting Functions" can help in this stuff
Thank you for the answer.
Yes, i want to use the configureChart in order to set the x-Axis, but I don't understand which functions help me to set days instead of hour range.
I was using to set some properties this configureChart script (to set decimals colors and so)
def configureChart(self, chart):
from java.awt import Color
from org.jfree.chart.renderer.category import StandardBarPainter
from java.text import DecimalFormat
from org.jfree.chart.axis import DateTickUnit
# Sets the tick units to one tick per day
chart.plot.domainAxis.tickUnit = DateTickUnit(DateTickUnit.DAY, 1)
# Sets the tick units to one tick per hour
chart.plot.domainAxis.tickUnit = DateTickUnit(DateTickUnit.HOUR, 1)
Welcome to the forum, Leandro. Please see Wiki - how to post code on this forum. (You hit the " blockquote button instead of the </> preformatted text button.)