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

Line graph, matching one comes sweeps

3 Answers 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
sumin park
Top achievements
Rank 1
sumin park asked on 07 Dec 2009, 11:27 AM

In the next Code,
When you run the program,
Line graph, matching one comes sweeps.

What's wrong?
What can I change?



       public MainPage()
        {
            InitializeComponent();
            SeriesMapping sm1 = new SeriesMapping();
            BarSeriesDefinition d1 = new BarSeriesDefinition();
            sm1.SeriesDefinition = d1;
            sm1.LegendLabel = "Bar Series";
            sm1.CollectionIndex = 0;

            ItemMapping im1 = new ItemMapping();
            im1.DataPointMember = DataPointMember.YValue;
            sm1.ItemMappings.Add(im1);

            SeriesMapping sm2 = new SeriesMapping();
            SplineSeriesDefinition d2 = new SplineSeriesDefinition();
            sm2.SeriesDefinition = d2;
            sm2.LegendLabel = "Spline Series";
            sm2.CollectionIndex = 1;

            ItemMapping im2 = new ItemMapping();
            im2.DataPointMember = DataPointMember.YValue;
            sm2.ItemMappings.Add(im2);

            RadChart1.SeriesMappings.Add(sm1);
            RadChart1.SeriesMappings.Add(sm2);

            List<double[]> itemsSource = new List<double[]>
            {
               
                new double[]{10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19},
                new double[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9}
            };

           
            this.RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;

            //this.RadChart1.DefaultView.ChartArea.AxisX.AddRange(1, 5, 1);
            this.RadChart1.DefaultView.ChartArea.AxisX.MinValue = 1;
            this.RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 21;
            this.RadChart1.DefaultView.ChartArea.AxisX.Step = 1;

            this.RadChart1.ItemsSource = itemsSource;

3 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 08 Dec 2009, 12:44 PM
Hi sumin park,

We're not really sure we understand what you are saying. Can you please show us a picture of the desired outcome of the chart and we will let you know if it can be achieved (and how) with RadChart.

Regards,
Vladimir Milev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
sumin park
Top achievements
Rank 1
answered on 09 Dec 2009, 04:04 AM
I insert 40 point, but X Asix is 0~40 (41 points).
Y Asix is 40 Points.
X Asix Is one more point..
I attach picture..








total source code..
            SeriesMapping sm1 = new SeriesMapping();
            BarSeriesDefinition d1 = new BarSeriesDefinition();
            sm1.SeriesDefinition = d1;
            sm1.LegendLabel = "Bar Series";
            sm1.CollectionIndex = 0;

            ItemMapping im1 = new ItemMapping();
            im1.DataPointMember = DataPointMember.YValue;
            sm1.ItemMappings.Add(im1);

            SeriesMapping sm2 = new SeriesMapping();
            SplineSeriesDefinition d2 = new SplineSeriesDefinition();
            sm2.SeriesDefinition = d2;
            sm2.LegendLabel = "Spline Series";
            sm2.CollectionIndex = 1;

            ItemMapping im2 = new ItemMapping();
            im2.DataPointMember = DataPointMember.YValue;
            sm2.ItemMappings.Add(im2);

            RadChart1.SeriesMappings.Add(sm1);
            RadChart1.SeriesMappings.Add(sm2);

            List<double[]> itemsSource = new List<double[]>
            {
                
                new double[]{10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19},
                new double[]{1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0}
                //new double[]{10,11,12,13,14,15,16,17,18,19},
                //new double[]{1,2,3,4,5,6,7,8,9,0}
            };

            
            this.RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
            this.RadChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal;

            //this.RadChart1.DefaultView.ChartArea.AxisX.AddRange(5, 11, 1);
            //this.RadChart1.DefaultView.ChartArea.AxisX.MinValue = 5;
            //this.RadChart1.DefaultView.ChartArea.AxisX.MinValue = 0;
            this.RadChart1.DefaultView.ChartArea.AxisX.MinValue = 0;
            this.RadChart1.DefaultView.ChartArea.AxisX.MaxValue = 40;
            this.RadChart1.DefaultView.ChartArea.AxisX.Step = 1;
            this.RadChart1.DefaultView.ChartArea.AxisX.LabelStep = 1;
            




            this.RadChart1.ItemsSource = itemsSource;

0
Giuseppe
Telerik team
answered on 11 Dec 2009, 04:47 PM
Hi sumin park,

This problem will be addressed in the latest internal build available for download in your Client.Net account later today.

Hope this helps.

All the best,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Chart
Asked by
sumin park
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
sumin park
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or