anvd
anvd

Reputation: 4047

change the color of grid plot -dojo

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

Upvotes: 4

Views: 2032

Answers (1)

Frode
Frode

Reputation: 5710

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);

Upvotes: 3

Related Questions