This is a migrated thread and some comments may be shown as answers.

Need Help in plotting the Line Chart using RadChart

1 Answer 303 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
kannan
Top achievements
Rank 1
kannan asked on 27 Mar 2009, 07:40 AM

Hi,
we are currently using the Radchart control(Demo version). At first it shows the error only in the RadChart control.
Error:
          Failed to create designer.

Then we search in Forums and find an hot fix. After installing the hot fix , the error goes off.

Here is our requirement.
We have the database with 4 Columns
Say X, Y, Y1, Z
we need to plot the graph Y, Y1 w.r.t X. The values of Y1 and Y  differ by large number. 'Z' is the constant and has to be plotted perpendicular to X-axis. Basically Y and Y1 should be horizontal graph and Z should be vertical graph.
Please guide us with the simple steps.


Other Questions:

1. How to plot the Y-axis minor gridlines. We followed the guide and set the value as per your guide.
 Y Axis Minor GridLine: PlotArea -> YAxis -> Appearance -> MinorGridLines
 But the value reset to 0 if we set the value and the gridlines did not appear in the chart. 
2.Can the X-axis value be plotted in the reverse-order.If so how?

3.Can the values of the series can be displayed as a tool tip in the Mouse-over event?

4. If we resize the control it shows the folowing error.
 Error 1: Object reference not set to instance of an object
 Error 2: Parameter value is not valid
 Error 3: There is no or empty series.
  Note: We have filled all the series.
5. We select line chart in type, but in design time the display automatically changes to bar chart. But in
run time it shows the line chart.

Can you help on this.

Regards




1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 30 Mar 2009, 03:11 PM
Hi Kannan,

Attached is a simple web page demonstrating the required scenario. We used two line series representing Y and Y1 columns from the data source. We also created a marked zone representing the constant value(Z).
Here is the markup:

 <telerik:RadChart ID="RadChart1" runat="server" OnItemDataBound="ItemDataBound"  
            DefaultType="Line"
            <Series> 
                <telerik:ChartSeries Name="Series 1" DataYColumn="Y" Type="Line"
                    <Appearance PointShape="Rectangle"
                        <FillStyle MainColor="213, 247, 255"
                        </FillStyle> 
                        <PointMark Visible="True" Figure="Diamond"
                            <FillStyle MainColor="Bisque" SecondColor="Bisque"
                            </FillStyle> 
                        </PointMark> 
                        <LabelAppearance Visible="false" /> 
                    </Appearance> 
                </telerik:ChartSeries> 
                <telerik:ChartSeries DataYColumn="Y1" Name="Series 2" Type="Line"
                    <Appearance> 
                        <FillStyle MainColor="218, 254, 122"
                        </FillStyle> 
                        <PointMark Visible="True" Figure="Diamond"
                            <FillStyle MainColor="Bisque" SecondColor="Bisque"
                            </FillStyle> 
                        </PointMark> 
                        <LabelAppearance Visible="false" /> 
                    </Appearance> 
                </telerik:ChartSeries> 
            </Series> 
            <PlotArea> 
                <MarkedZones> 
                    <telerik:ChartMarkedZone Name="Marked zone 1" ValueEndX="6" ValueEndY="100" ValueStartX="6"
                        <Appearance> 
                            <Border Width="2" Color="Pink" /> 
                        </Appearance> 
                    </telerik:ChartMarkedZone> 
                </MarkedZones> 
            </PlotArea> 
        </telerik:RadChart> 


Onto your other questions:
  1. You can toggle the visibility of the minor grid lines with code like this (I am not really sure about the zero-value you mentioned, the Visible property is boolean):
    RadChart1.PlotArea.YAxis.Appearance.MinorGridLines.Visible = true; //false; 
  2. RadChart does not provide this functionality out-of-the-box. Instead, you could try to manually inverse the order of the elements in the underlying data source.
  3. You can make RadChart to show item tooltips by subscribing to the ItemDataBound event and setting the desired tooltip string. Another thing you might want to do is to make the ChartSeries point marks visible, as for line series RadChart does not support tooltips over the entire line, but only when hovering the pointmarks. A workaround here would be to show transparent pointmarks, so that the tooltips are shown when hovering the point marks, but still they are not displayed. Here is a sample code:
    //ItemDataBound event handler 
        protected void ItemDataBound(object sender, ChartItemDataBoundEventArgs e) 
        { 
            e.SeriesItem.ActiveRegion.Tooltip = "Tooltip"
        } 
     
    //Enable point marks 
                    <telerik:ChartSeries DataYColumn="Y1" Name="Series 2" Type="Line"
                        <Appearance> 
                            <FillStyle MainColor="218, 254, 122"
                            </FillStyle> 
                            <PointMark Visible="True" Figure="Diamond"
                                <FillStyle MainColor="Transparent" SecondColor="Transparent"
                                </FillStyle> 
                            </PointMark> 
                            <LabelAppearance Visible="false" /> 
                        </Appearance> 
  4. We will need additional information to reproduce this issue. A simple project where the problem appears would help us to sort this out.
  5. Try setting the RadChart DefaultType property to Line.

Hope this will help.

Greetings,
Velin
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
kannan
Top achievements
Rank 1
Answers by
Velin
Telerik team
Share this question
or