Wizard keep closing on it's on

Thread is closed for posting
3 posts, 1 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 15 Mar 2009 Link to this post

    environment

    RadControls version

    2008 q3
    .NET version

    3.4
    Visual Studio version

    2008
    programming language

    c#

    PROJECT DESCRIPTION
    Hello, I would like to make a chart like this: http://uswebpro.com/temp/chart.gif
    My datasource looks like this: http://uswebpro.com/temp/salePErEventDay.gif
    I am trying to use the chart wizard for this. However when ever I make a change, it closes automatically.
    example, right after I make the change picutred here, it closes: http://uswebpro.com/temp/chart-wiz.gif

    Could someone please tell me why it keeps closing, or just tell me how to set the chart up manually? Many thanks!


  2. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 17 Mar 2009 Link to this post

    Hello Kansa,

    Indeed, this seems to be a bug in the chart wizard. I have attached a small example of a similar chart.  In order to get this running without sending database files I have used a DataTable to populate the chart.

    As RadChart does not support DateTime values, but it supports their OLE Automation equivalents, so there are 3 double columns and not two double and one DateTime column. You can still use the same chart with a SqlDataSource -- just remove the entire code behind and update your SqlDataSource as shown in this forum post, so that DateTime values are converted to doubles.

    Regards,
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 19 Mar 2009 Link to this post

    Worked like a charm, thanks Ves

    Sample code:

     <telerik:RadChart ID="RadChart1" runat="server" AutoLayout="true" Skin="Hay" Visible="false" Width="1000">
                <Series>
                    <telerik:ChartSeries Name="DailyRevenue" DataYColumn="DailyRevenue">
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Name="TotalOrders" DataYColumn="TotalOrders">
                    </telerik:ChartSeries>
                </Series>
                <PlotArea>
                    <XAxis IsZeroBased="false" DataLabelsColumn="OrderDate">
                        <Appearance ValueFormat="ShortDate">
                        </Appearance>
                    </XAxis>
                </PlotArea>
            </telerik:RadChart>

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            RadChart1.Visible = true;

            DataTable tbl = new DataTable();
            DataColumn col = new DataColumn("OrderDate");
            col.DataType = typeof(double);
            tbl.Columns.Add(col);
            col = new DataColumn("DailyRevenue");
            col.DataType = typeof(double);
            tbl.Columns.Add(col);
            col = new DataColumn("TotalOrders");
            col.DataType = typeof(double);
            tbl.Columns.Add(col);

            VSalePerEventPerDayCollection vcol = new VSalePerEventPerDayCollection().Where(VSalePerEventPerDay.Columns.ShowId, ShowSelectorControl1.SelectedValue).Load();

            foreach (VSalePerEventPerDay day in vcol)
            {
                tbl.Rows.Add(new object[] { day.OrderDate.Value.ToOADate(), day.DailyRevenue, day.TotalOrders });
            }

            RadChart1.ChartTitle.TextBlock.Text = ShowSelectorControl1.SelectedItem.Text;
            RadChart1.DataSource = tbl;
            RadChart1.DataBind();
        }

Back to Top