Welcome Guest Search | Active Topics |

Plotlines in code behind.
tlewi2
#1 Posted : Thursday, December 05, 2013 7:14:35 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Could you give me the syntax for adding plotlines in the code behind? Currently, I'm using the following method but strangely this only works sometimes.

aspx:

<Axes>
<jqChart:LinearAxis Location="Bottom" ZoomEnabled="True" Name="MyXAxis">
</jqChart:LinearAxis>
</Axes>
<Axes>
<jqChart:LinearAxis Location="Left" Name="MyYAxis">
<PlotLines>
<jqChart:PlotLine>
</jqChart:PlotLine>
<jqChart:PlotLine>
</jqChart:PlotLine>
</PlotLines>
</jqChart:LinearAxis>
</Axes>

In the code behind (Page_Load):

JQChart.Web.UI.WebControls.LinearAxis Yaxis = Chart2.Axes(1) as JQChart.Web.UI.WebControls.LinearAxis;

Yaxis.PlotLines(0).StrokeStyle = "Red";
Yaxis.PlotLines(0).Value = 1.0;
Yaxis.PlotLines(1).StrokeStyle = "Blue";
Yaxis.PlotLines(1).Value = 0.6;
Dragan
#2 Posted : Thursday, December 05, 2013 7:32:14 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Try defining your axes in one <Axes></Axes> collection:
Code:
<Axes>
            <jqChart:LinearAxis Location="Bottom" ZoomEnabled="True" Name="MyXAxis">
            </jqChart:LinearAxis>
            <jqChart:LinearAxis Location="Left" Name="MyYAxis">
                <PlotLines>
                    <jqChart:PlotLine>
                    </jqChart:PlotLine>
                    <jqChart:PlotLine>
                    </jqChart:PlotLine>
                </PlotLines>
            </jqChart:LinearAxis>
        </Axes>
Best Regards,
Dragan Matek
jqChart Inc.
tlewi2
#3 Posted : Thursday, December 05, 2013 7:57:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
I defined the axes as below, but the plotlines only show on some of the graphs I display. Although, it seems to be consistant and based on the data being graphed. Sometimes the red plotline displays, sometimes the blue plotline displays, sometimes both, sometimes neither. But when I get out and get back into the same graph it does not change. So, if the graph only displayed the red plotline by getting out an back in it will still only display the red plotline.
I have run this in debug the the below code behind plotline statement are be executed.
Ivan
#4 Posted : Thursday, December 05, 2013 8:01:07 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Is it possible to send us (to support@jqchart.com ) your sample, so we can investigate it?
Best,
Ivan Petrov
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.134 seconds.