user597960
user597960

Reputation: 23

How do you always show the 0 tick line in a chart in JPGraph?

I'm generating a chart with JPGraph, with manual scales but auto ticks. The chart currently doesn't show the 0 line tick, which is very important for data analysis. Chart without 0 I would love to show the 0 tick line like the 100,-100, 300 etc. lines are shown here. I can't set manual ticks as the chart max and min scales vary from chart to chart and I can't find a linear relation between ticks and whether or not it shows the 0 tick line. The only solution I've been able to implement is a gray line

    $zeroAxis = new Plot\PlotLine(HORIZONTAL, 0, 'gray', 1);
    $graph->Add($zeroAxis);

This draws a gray line where the 0 should be. But I would really like to have the "0" text printed as well... enter image description here

If you can point me to a solution I would be glad, whether it's drawing the "0" manually or pointing me to the option to always show the 0 tick (if there is one, as far as I looked inside the documentation, there isn't one). Thank you in advance.

Upvotes: 0

Views: 14

Answers (0)

Related Questions