BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
<chart:SfChart.Title>
<chart:ChartTitle Text="{Binding Title}" BackgroundColor="{Binding ChartColor}" FontSize="12"/>
</chart:SfChart.Title> |
public string Title { get; set; }
public ChartModel(ChartSeriesCollection seriesCollection, Color chartColor, string title)
{
SeriesCollection = seriesCollection;
ChartColor = chartColor;
Title = title;
} |
ChartData = new ObservableCollection<ChartModel>()
{
new ChartModel(
new ChartSeriesCollection()
{
new LineSeries()
{
//or else bind your data model.
ItemsSource = new ObservableCollection<Model>(){new Model("Information Technology", 32), new Model("India",53),new Model("Saudi",26), new Model("USA",82), new Model("Japan",43),
},
XBindingPath = "Countries",
YBindingPath = "Count",
XAxis = new CategoryAxis(),
YAxis = new NumericalAxis(),
},
}, Color.LightCoral, "Line Series"
), |
public ChartTitle Title { get; set; } |
ChartData = new ObservableCollection<ChartModel>()
{
new ChartModel(
new ChartSeriesCollection()
{
new LineSeries()
{
//or else bind your data model.
ItemsSource = new ObservableCollection<Model>(){new Model("Information Technology", 32), new Model("India",53),new Model("Saudi",26), new Model("USA",82), new Model("Japan",43),
},
XBindingPath = "Countries",
YBindingPath = "Count",
XAxis = new CategoryAxis(),
YAxis = new NumericalAxis(),
},
}, Color.LightCoral, null //Set null for other than pie series.
),
new ChartModel(
new ChartSeriesCollection()
{
new PieSeries()
{
//or else bind your data model.
ItemsSource = new ObservableCollection<Model>(){new Model("Information Technology", 32), new Model("India",43),new Model("Saudi",23), new Model("USA",54), new Model("Japan",63)},
XBindingPath = "Countries",
YBindingPath = "Count",
},
}, Color.LightGray, new ChartTitle(){Text="Pie Series", FontSize= 12, BackgroundColor = Color.LightGray}
),
} |