|
ChartAdornmentInfo adornmentInfo = new ChartAdornmentInfo()
{
AdornmentsPosition = AdornmentsPosition.Top,
LabelPosition = AdornmentsLabelPosition.Outer,
ShowLabel = true,
HighlightOnSelection = true,
}; |
|
CategoryAxis xAxis = new CategoryAxis();
sampleChart.PrimaryAxis = xAxis;
xAxis.LabelFormat = "dd/MM/yyyy"; |
|
private void EditoGraficoColumn()
{
grid.Children.Clear();
// Create a SfChart
SfChart sampleChart = new SfChart();
//Add the legend to the chart
sampleChart.Legend = new ChartLegend();
// Add the axes to the chart
CategoryAxis xAxis = new CategoryAxis();
xAxis.LabelFormat = "dd/MM/yyyy";
sampleChart.PrimaryAxis = xAxis;
NumericalAxis yAxis = new NumericalAxis();
sampleChart.SecondaryAxis = yAxis;
ColumnSeries series1 = new ColumnSeries();
series1.ItemsSource = GiornataList;
series1.XBindingPath = "XValue";
series1.YBindingPath = "YValue1";
sampleChart.Series.Add(series1);
//Add the chart to grid.
grid.Children.Add(sampleChart);
} |