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

Wizard keep closing on it's on

2 Answers 35 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 2
Aron asked on 15 Mar 2009, 09:20 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 17 Mar 2009, 08:05 AM
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.
0
Aron
Top achievements
Rank 2
answered on 19 Mar 2009, 08:59 AM
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();
    }

Tags
Chart (Obsolete)
Asked by
Aron
Top achievements
Rank 2
Answers by
Ves
Telerik team
Aron
Top achievements
Rank 2
Share this question
or