3 Answers, 1 is accepted
Thank you for writing.
You should set the ClipLabels property to false for the horizontal axis:
public Form1(){ InitializeComponent(); LineSeries series = new LineSeries(); series.DataPoints.Add(new CategoricalDataPoint(6, DateTime.Now)); series.DataPoints.Add(new CategoricalDataPoint(4, DateTime.Now.AddDays(1))); series.DataPoints.Add(new CategoricalDataPoint(7, DateTime.Now.AddDays(2))); series.DataPoints.Add(new CategoricalDataPoint(5, DateTime.Now.AddDays(3))); DateTimeCategoricalAxis categoricalAxis = new DateTimeCategoricalAxis(); categoricalAxis.DateTimeComponent = DateTimeComponent.Day; categoricalAxis.ClipLabels = false; series.HorizontalAxis = categoricalAxis; radChartView1.Series.Add(series);}I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Hi Dess.
Tanks for the reply.
The example works, but how can I do if I use DataSource?
In this case, assigne categoricalAxis to the series produces two axes x:
Dim categoricalAxis As New DateTimeCategoricalAxis()
categoricalAxis.ClipLabels = False
With RadChartView1
.Series.Clear()
.ShowLegend = True
.LegendTitle = "Legenda"
.Controllers.Add(New SmartLabelsController())
.ShowGrid = True
End With
With Spese
.ValueMember = "SpeseAl"
.CategoryMember = "Aggiornamento"
.LegendTitle = "Spese"
.DataSource = dt
.ShowLabels = True
.Palette = New PaletteEntry(Color.Gainsboro, Color.Green)
.HorizontalAxis = categoricalAxis
End With
RadChartView1.Series.Add(Spese)
see attached image.
Thank you for writing back.
Please refer to the following code snippet demonstrating how to access the horizontal axis when binding RadChartView and disable labels clipping:
Private table As DataTableSub New() InitializeComponent() table = New DataTable() table.Columns.Add("Value", GetType(Double)) table.Columns.Add("Name", GetType(String)) Dim rand As New Random For index = 1 To 10 table.Rows.Add(rand.Next(0, 50), DateTime.Now.AddDays(index)) Next Dim lineSeria As New LineSeries() RadChartView1.Series.Add(lineSeria) lineSeria.ValueMember = "Value" lineSeria.CategoryMember = "Name" lineSeria.DataSource = table lineSeria.HorizontalAxis.ClipLabels = FalseEnd SubI hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
