4

i am using this code:

chart1.addPlot("grid", {
type: "Grid", 
hMinorLines: true
});

how i can change the color of the grid, and the interval between each line ? It is possible, right?

thanks

enter image description here

anvd
  • 3,997
  • 19
  • 65
  • 126

1 Answers1

3

The Grid's intervals between lines are determined by the tick step parameters you give to the axis. So if you want major horizontal lines/ticks for every integer, and minor horizontal lines for every .25, you can do:

chart1.addAxis("y", {
    ...
    majorTickStep: 1, 
    minorTickStep: 0.25
});

To change the color of the grid lines, the only way I know of is to manipulate the theme you are using.

var myTheme = dojox.charting.themes.PlotKit.blue; // Or any other theme

myTheme.axis.majorTick.color = "green";
myTheme.axis.minorTick.color = "red";

chart1.setTheme(myTheme);
Frode
  • 5,600
  • 1
  • 25
  • 25
  • You can use majorHLine, minorHLine, majorVLine, minorVLine options for changing colors. At least for dojo 1.8 and up (not sure about the previous versions). – Martin Komara Nov 18 '13 at 14:43