Telerik Forums
UI for Silverlight Forum
4 answers
61 views

Hi There,

 I am trying turn of smart label on particular chart point by right click and  making its visibility to be collapsed.I tried to find some work around on data point  ,legend connectors but I could not figure any kind of solution.

 We have requirement where a user wants to turn of smart lable on particular point by right click  and turn off from context menu. Any kind of sample project will really help us.

 ThankYou,

 
Petar Marchev
Telerik team
 answered on 24 Feb 2016
5 answers
292 views

I am adding two line series chart with common x-axis (which is the date range selected) which is already sorted. Now the issue is that if any of the series don't have data for a particular date than those dates automatically gets shifted to the end.

Suppose if we have date range(x-axis) configured from 1st Nov 2013 to 30th Nov 2013 and for one series data is not there 21 to 29 Nov but the other series have data, than these dates gets shifted to the end. Please see the attached image "WrongDateInMiddle.png" for better understanding of the issue.

What I want is that if there is no data for particular dates than chart should show gaps instead of shifting those dates to the end. Something like the functionality available in "Telerik Ajaz HTML Charts" and shown in the attached image "ajax_htmlchart_various_data_types.png"

 

Code:
I am adding two line series and binding them to two different data sources. After that running a foreach loop to go through each series and make the chart. See code below, here chartSetting.Series contains both the series for whom line chart is to be created.

 

var count = 0;
    foreach( var setting in chartSetting.Series )
    {
        UpdateChartArea( chartSetting, setting, count );
 
        UpdateSeriesMapping( chartSetting, setting );
 
        count++;
    }
 
private void UpdateChartArea( CustomChartSetting chartSetting, CustomChartSeriesSetting setting, int count )
        {
            //Axis
            var axisY = new AxisY();
            axisY.DefaultLabelFormat = setting.YAxisDisplayFormat;
            axisY.Title = setting.YAxisLabel;
 
            if( count == 0 )
            {
                var axisX = new AxisX();
                axisX.DefaultLabelFormat = chartSetting.XAxisDisplayFormat;
                axisX.Title = chartSetting.XAxisLabel;
                radChart.DefaultView.ChartArea.AxisY = axisY;
                radChart.DefaultView.ChartArea.AxisX = axisX;
            }
            else if( setting.UseAdditionalYAxis )
            {
                radChart.DefaultView.ChartArea.AdditionalYAxes.Add( axisY );
            }
 
            //CustomGridLine
            if( setting.UpperLimit != null )
            {
                var upperLimit = new CustomGridLine();
                upperLimit.YIntercept = setting.UpperLimit.Value;
                radChart.DefaultView.ChartArea.Annotations.Add( upperLimit );
            }
 
            if( setting.LowerLimit != null )
            {
                var lowerLimit = new CustomGridLine();
                lowerLimit.YIntercept = setting.LowerLimit.Value;
                radChart.DefaultView.ChartArea.Annotations.Add( lowerLimit );
            }
        }
 
        private void UpdateSeriesMapping( CustomChartSetting chartSetting, CustomChartSeriesSetting setting )
        {
            if( chartSetting.XAxisValue != null && setting.YAxisValue != null )
            {
                var seriesMapping = new SeriesMapping();
                seriesMapping.ItemsSource = setting.Details;
                seriesMapping.LegendLabel = setting.YAxisLabel;
 
                //Rotate lables if there are too many record
                radChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = setting.Details != null ? ( setting.Details.Count > 20 ? -90 : setting.Details.Count > 10 ? -50 : 0 ) : 0;
 
                seriesMapping.SeriesDefinition = setting.ChartType == ConfigurableChartType.Bar ? new BarSeriesDefinition() : ( setting.ChartType == ConfigurableChartType.Line ? new LineSeriesDefinition() : seriesMapping.SeriesDefinition = new PieSeriesDefinition() );
 
                ItemMapping itemMapping = new ItemMapping();
                itemMapping.DataPointMember = setting.ChartType == ConfigurableChartType.Pie ? DataPointMember.LegendLabel : DataPointMember.XCategory;
                itemMapping.FieldName = chartSetting.XAxisValue;
 
                seriesMapping.ItemMappings.Add( itemMapping );
 
                itemMapping = new ItemMapping();
                itemMapping.DataPointMember = DataPointMember.YValue;
 
                seriesMapping.ItemMappings.Add( itemMapping );
 
                radChart.SeriesMappings.Add( seriesMapping );
 
                this.radChart.CreateItemStyleDelegate = BuildCustomItemStyle;
            }
        }

Peshito
Telerik team
 answered on 22 Jan 2016
7 answers
102 views
Hi Team,
 We have purchased RadControls_for_Silverlight5_2013_1_0403_Dev.msi. We have a requirement, where if we have a null value in the collection.. we have to show a dotted line in Rad Chart line series, that looks like connecting points. Currently by default it is shown as a gap between point marks, which is so annoying.

Please help me!
Martin Ivanov
Telerik team
 answered on 22 Jan 2016
1 answer
46 views

I have a chart where-in I have to display a graph and tooltip which shows "round-off" values.

sb.AppendFormat(string.Format("#XCAT : {0} #DATAITEM.OriginalValue", displayCurrency));

 

This only shows original value on the tooltip. I want round-off value of the decimal.

Please help.

Thanks in advance

 

 

Ivan
Telerik team
 answered on 21 Dec 2015
7 answers
138 views

Hi There,

 Is there any way where we can find if chart is some data or not. I know it will display "No Data" template when there is no data I want know a property which triggers it. Why I need so because we have chart and some other UI  element like grid... which should syn other UI element when there is some data on chart.

Basically I am looking  for some property like "IsChartHasSomeData"  . Please help me to know this  I mean how can we do this.?

 

 

Petar Marchev
Telerik team
 answered on 15 Dec 2015
1 answer
51 views

Hi,

I have a top N style bar chart with 2 series, inputs and ouputs.  X axis is company names, and y axis is an aggregate of the amount.  This is much like the documentation at http://docs.telerik.com/devtools/wpf/controls/radchart/features/grouping/and-aggregation and the second last picture where you show the sum of all apples and bananas per year and region.   For ​2008 I have inputs, and for 2009 I have outputs, for regions I have companies and for quantity I have amount. I have the correct data displayed, but I want to sort the data so that, in your example, the region with the highest 2008 figure comes first, so Europe(331) is on the top, then North America (322), then Asia (316).  In other words the sorting is defined by one of the series. How can I do that? 

 

Thanks

Petar Marchev
Telerik team
 answered on 22 Oct 2015
5 answers
53 views

Hello,

If we zoom to an area where there is no data point, the entire chart is removed and replaced with the no data control.

Is there a way to change that behavior, so that no data will never be shown if originally(zoom=1.0) we had some data?

Thank you,

herme
Top achievements
Rank 1
 answered on 30 Sep 2015
9 answers
160 views
Hi all,

I  want to implement multi-level (minimum 3 level) drill down functionality. I had seen samples with 2 level only. How do I do that? Any sample application would be appreciated.

Thanks
Stef
Telerik team
 answered on 18 Sep 2015
6 answers
296 views
Can someone please give me a simple example on how  to make a horizontal stacked bar chart? I'm finding it very difficult to grasp the charting controls, and I'm under a tight deadline at the moment. I just need a single horizontal bar (not 3D) with 3 stacks colored green, red, and gray. I can get 3 separate bars to display, but I can't stack them into a single bar. What am I missing? If someone can throw together a few lines of code to show me an example, that would be very helpful.

Thanks,
Eric
Evgenia
Telerik team
 answered on 12 Aug 2015
3 answers
90 views

 In our project we are using the RadCartesianChart and we want to (dynamically) display some vertical lines.

For this we have code like the following in place: 

var collection = GetSomeFilteredData();
foreach (var dateTime in collection)
            {
                var cartesianGridLineAnnotation = new CartesianGridLineAnnotation
                {
                    ZIndex = -100,                     
                    Value = dateTime, 
                    Stroke = new SolidColorBrush(Colors.Black), 
                    StrokeThickness = 1, 
                    Axis = this.HorizontalAxis
                };

                this.ChartControl.Annotations.Add(cartesianGridLineAnnotation);
            }

 

When debugging I can verify that the data is loaded and added to the ChartControl.Annotations collection. But it doesn't display.

Other than that, everything works fine (e.g. display of static horizontal lines  as declared in xaml, which are also in the Annotations collection).

 

Any idea what I am missing here?

Also, is there a "better" way of achieving our goal? I would like it if I could just bind a collection in the ViewModel to a property of the chart.

Thanks in advance for any help. 

 

 

Martin Ivanov
Telerik team
 answered on 31 Jul 2015
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?