Hi all, is there a function for chart Gridlines? and if so what is it? any document to see the list of function in BIRT ? thanks
For fixed gridline settings, go to the Format Chart tab and edit the X-Axis and Y-Axis poperties. Click the "Gridlines" button near the bottom to set the properties. The gridline settings can also be changed in code.
_In the beforeDrawAxis event function, use_:
axisOptions.gridLineWidth = 1 axisOptions.gridLineColor = "#0000FF"
Or in the beforeGeneration event function, use:
options.xAxis.gridLineWidth = 1 options.xAxis.gridLineColor = "#0000FF"
options.yAxis[0].gridLineWidth = 1 options.yAxis[0].gridLineColor = "#0000FF"
Note: The beforeDrawAxis event runs for each axis which is why the X and Y aren't specified. The beforeGeneration event runs once, so the X and Y axes must both be configured.
The reference is the Highcharts API:
https://api.highcharts.com/highstock/xAxis.gridLineWidth
The Event Functions in the editor have parameters. If you type the name of a parameter followed by a period, the context sensitive menu will pop up showing you the methods from the Highcharts API. For example, in
beforeGeneration: function(options),
If you type:
options.
(include the trailing period)
You will see the xAxis and yAxis objects that I used in my code:
They can also be found in the Highcharts API:
thanks Jeff, this is very helpful, What I am trying to do is a little more tricky I have already applied min 1 to max 6 and step interval 0.5 in chart scale X-Axis, and the Gridlines appears accordingly, how ever I was wandering if it is possible to make every 0.5 step disappear without changing any data or scale for x-Axis? this way x-Axis value shows as we want and also Axis value position stay center. but I am not sure if it is possible. thanks
On the Select Data tab of the chart editor, if you set the X-Axis grouping interval to 1 as shown below, the data will be displayed in steps of 1 even if the step interval is 0.5.
-
To change the X-axis labels, go to the Format Chart tab, select X-Axis on the left, and click the Label button. Set the Interval to 2. With the step set to 0.5, the labels will display every step of 1.
Thanks