How to add multiple YAxis

Jan 12, 2012 at 12:30 PM
Edited Jan 12, 2012 at 12:34 PM
 Hi! I have tied to add multiple YAxis to chart but it was not successful. Could you please advice some solution to do it? 
My code is:
<highchart:LineChart ID="hcVendas" Width="700" Height="450" runat="server" />

hcVendas.YAxis.Add(new YAxisItem { title = new Title("First Axis") }); 

hcVendas.YAxis.Add(new YAxisItem { title = new Title("Second Axis"), opposite = true });

But when I'm debugging JQuery found only the last axis was created.

yAxis: [{"opposite":true,"title":{"text":"Second Axis"}}],

Thanks and Regards,

G.

Developer
Jan 12, 2012 at 1:17 PM
Edited Jan 12, 2012 at 1:18 PM

There appears to be a bug in YAxis.cs and XAxis.cs that is causing multiple axes to not be rendered.

To fix this, make the following change in YAxis.cs:

Replace:

        return string.Format("yAxis: [{0}],", ignored);

With:

        var serialize = string.Join(",", keys.ToArray());
        string.Format("yAxis: [{0}],", serialize);

Make the corresponding change in XAxis.cs to fix this issue in that file as well.

I hope this helps. Please let us know if you continue to face problems.

Regards,

Rahul

 

Jan 12, 2012 at 2:06 PM

Hi! Yes I have already found it after downoading and debugging source. I did similar change. It works now.

Thanks for your help.

G.