Chart is not working

Thread is closed for posting
2 posts, 0 answers
  1. Joe Adlin
    Joe Adlin avatar
    1 posts
    Member since:
    Aug 2009

    Posted 21 Aug 2009 Link to this post

    Hi Team,
    I created a sample application for the chart and it is not working for me.
    But the same app is working in others machine.
    I used static contents for the chart. Below is the code for your reference. I have nothing in the code behind file.

    Do i need to register anything in GAC or any environment variable path needs to be set?...

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestRadChartInWebForm.aspx.cs" Inherits="RadChartSample.TestRadChartInWebForm" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadChart ID="RadChart1" runat="server" Width="480px" Height="290px">
                <PlotArea>
                    <XAxis>
                    </XAxis>
                    <YAxis>
                    </YAxis>
                    <YAxis2>
                    </YAxis2>
                </PlotArea>
                <Series>
                    <telerik:ChartSeries Name="Series 1">
                        <Appearance>
                            <FillStyle MainColor="Blue">
                            </FillStyle>
                        </Appearance>
                        <Items>
                            <telerik:ChartSeriesItem YValue="1" Name="Item 1">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="2" Name="Item 2">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="4" Name="Item 3">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="3" Name="Item 4">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="5" Name="Item 5">
                            </telerik:ChartSeriesItem>
                        </Items>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Name="Series 2" YAxisType="Secondary">
                        <Appearance>
                            <FillStyle MainColor="Red">
                            </FillStyle>
                        </Appearance>
                        <Items>
                            <telerik:ChartSeriesItem YValue="15" Name="Item 1">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="25" Name="Item 2">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="45" Name="Item 3">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="35" Name="Item 4">
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="50" Name="Item 5">
                            </telerik:ChartSeriesItem>
                        </Items>
                    </telerik:ChartSeries>
                </Series>
            </telerik:RadChart>    
        </div>
        </form>
    </body>
    </html>

    Thanks,
    Joe
  2. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 25 Aug 2009 Link to this post

    Hello Joe,

    Let me start with one problem I see in the markup you have provided. You will need a second Register directive:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

    It is added automatically if you drag and drop the control onto the design surface in visual studio.  You will also need to register the chart httphandler in the web.config file. The easiest way to do this is to use the control smart tag as shown here (check #5).

    In order to enable the design time for the control, you will need the Telerik.Web.Design assembly. It is installed in the GAC by the RadControls setup, but if you have used a .zip package you will need to add it to GAC or to the local Bin folder manually. You can find more details here.

    Finally, if these do not seem to help, please elaborate on the issue -- do you get any error message? What does it say if any?

    Sincerely,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top