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

Chart axis and points

1 Answer 187 Views
Chart
This is a migrated thread and some comments may be shown as answers.
NS
Top achievements
Rank 1
NS asked on 03 Nov 2008, 10:53 AM
Hi,

I've implemented a chart with multiple areas (i get the percentages of the cpu's and add it to the chart data) but i have some problems:

  1. How can i add a fixed Y-axis (0-100 major tick 10 minor 5) because now it's dynamic (changes if value is greater or smaller then axis)
  2. How can i make the X-axis start at 0 because now i've got a gap between the first value and the Y-axis (because Y is always 1 as start)
  3. How can i remove the label on the points displaying the value

Code for populating the chart:

        DataSeries splineAreaSeriesCPU1 = null;  
        DataSeries splineAreaSeriesCPU2 = null;  
        public void fillProcessorChart()  
        {  
            splineAreaSeriesCPU1 = new DataSeries();  
            splineAreaSeriesCPU2 = new DataSeries();  
 
            splineAreaSeriesCPU1.Definition = new SplineAreaSeriesDefinition();  
            splineAreaSeriesCPU2.Definition = new SplineAreaSeriesDefinition();  
 
            ChartArea1.DataSeries.Add(splineAreaSeriesCPU1);  
            ChartArea2.DataSeries.Add(splineAreaSeriesCPU2);  
              
        }  
 
        public static void FillWithSampleData(DataSeries series, double PcValue)  
        {  
            series.Add(new DataPoint { XValue = series.Count() , YValue = PcValue });  
              
              
            if (series.Count()>10)  
                series.RemoveAt(0);  
        } 

XAml
                <telerik:RadChart x:Name="RadChart1" Margin="8,8,8,8" Grid.Row="3" Grid.Column="2"  UseDefaultLayout="False" VirtualizingStackPanel.VirtualizationMode="Recycling">  
                      
 
                    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">  
                        <Grid.RowDefinitions> 
                            <RowDefinition Height="0.5*" /> 
                            <RowDefinition Height="0.5*" /> 
                        </Grid.RowDefinitions> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="*" /> 
 
                        </Grid.ColumnDefinitions> 
 
 
                        <telerik:ChartArea Grid.Row="0" x:Name="ChartArea1" > 
                            <telerik:ChartArea.AxisY> 
                                <telerik:AxisY MajorGridLinesVisibility="Collapsed" 
                                               MinorTicksVisibility="Visible" 
                                               Title="CPU 1" /> 
                            </telerik:ChartArea.AxisY> 
                        </telerik:ChartArea> 
 
 
                        <telerik:ChartArea Grid.Row="1" x:Name="ChartArea2" > 
                            <telerik:ChartArea.AxisY> 
                                <telerik:AxisY MajorGridLinesVisibility="Collapsed" 
                                               MinorTicksVisibility="Visible" 
                                               Title="CPU 2" /> 
                            </telerik:ChartArea.AxisY> 
                        </telerik:ChartArea> 
 
 
                    </Grid> 
                </telerik:RadChart> 

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 06 Nov 2008, 04:43 PM
Hi NS,

Straight to your questions:
  1. Unfortunately, this is not supported. For the moment RadChart supports only auto-scaled axes.
  2. Sorry to say it again - not supported. Both these are already in our TODO list and your feedback counts when considering their priority.
  3. This has been added to RadChart and with the official version, which will be available today, you will be able to add these lines:
splineAreaSeriesCPU1.Definition.ShowItemLabels = false;
splineAreaSeriesCPU2.Definition.ShowItemLabels = false;

I have updated your Telerik points for the valuable feedback.

Sincerely,
Ves
the Telerik team

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