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

Reporting chart - Remove XAxis duplicates

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Giuliano Caetano
Top achievements
Rank 1
Giuliano Caetano asked on 21 Jan 2012, 12:55 PM
Hi telerik team,
I'm developing a reporting char, and I needed your support:
My chart have many duplicate xaxis (with the hours of the records.) and i just want remove it.
I put a chart image in attachment and i leave the source...

private void PositionTempChartNeedDataSource(object sender, EventArgs e)
{
PositionTempChart.DataSource = this.DataSource;
 
var procChart = (Telerik.Reporting.Processing.Chart)sender;
var defChart = (Telerik.Reporting.Chart)procChart.ItemDefinition;
 
defChart.IntelligentLabelsEnabled = false;
defChart.PlotArea.Appearance.Dimensions.Margins.Top = Unit.Pixel(25);
defChart.PlotArea.Appearance.Dimensions.Margins.Bottom = Unit.Pixel(25);
defChart.PlotArea.Appearance.Dimensions.Margins.Left = Unit.Pixel(25);
defChart.PlotArea.Appearance.Dimensions.Margins.Right = Unit.Pixel(0);
             
var temperature1 = new ChartSeries { Type = ChartSeriesType.Line };
temperature1.Clear();
temperature1.DataYColumn = "Temp1";
temperature1.DataXColumn = "DoubleDateTime";
temperature1.Appearance.ShowLabels = false;
temperature1.Appearance.LineSeriesAppearance.Color = System.Drawing.ColorTranslator.FromHtml("#86D8A0");
temperature1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
defChart.Series.Add(temperature1);
 
var temperature2 = new ChartSeries { Type = ChartSeriesType.Line };
temperature2.Clear();
temperature2.DataYColumn = "Temp2";
temperature2.DataXColumn = "DoubleDateTime";
temperature2.Appearance.ShowLabels = false;
temperature2.Appearance.LineSeriesAppearance.Color = System.Drawing.ColorTranslator.FromHtml("#F09081");
temperature2.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
defChart.Series.Add(temperature2);
 
defChart.PlotArea.XAxis.DataLabelsColumn = "DoubleDateTime";
defChart.PlotArea.XAxis.IsZeroBased = false;
defChart.PlotArea.XAxis.AutoScale = false;
defChart.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortTime;
defChart.PlotArea.XAxis.Appearance.CustomFormat = "HH";
}


Can you help us? 
Thanks
Giuliano Caetano

1 Answer, 1 is accepted

Sort by
0
Giuliano Caetano
Top achievements
Rank 1
answered on 24 Jan 2012, 11:47 AM
Hi, already works,
I have a record by minute, so i just added the code below:

defChart.PlotArea.XAxis.IsZeroBased = false;
defChart.PlotArea.XAxis.AutoScale = false;
defChart.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortTime;
defChart.PlotArea.XAxis.Appearance.CustomFormat = "HH";
defChart.PlotArea.XAxis.Step = 60;
defChart.PlotArea.XAxis.LabelStep = 60;

Tks...
Giuliano Caetano
Tags
General Discussions
Asked by
Giuliano Caetano
Top achievements
Rank 1
Answers by
Giuliano Caetano
Top achievements
Rank 1
Share this question
or