I'm fairly new to the use of SyncFusion WinForms controls (my prior experience has been with DevExpress)
I'm trying to create a chart that displays 2 column series with a numeric Y axis and a Category based X axis.
The chart is intended to display a set of Fund Names on the X axis, with the Book Cost and Current Value on the Y Axis (that description might make a little more sense)
The starting point I've used for creating the Chart is to use the following from the online documentation (for binding to IEnumerable)
The code I'm using based on this is as follows:
var bookCost = new ArrayList();
currentFundValuesChart.Series.Clear();
foreach (FundSummaryRow row in e)
{
bookCost.Add(new CurrentFundValuesChartBookCost { Fund = row.Holding, BookCost = row.AmountInvested, CurrentValuation = row.CurrentValue });
}
currentFundValuesChart.PrimaryXAxis.ValueType = ChartValueType.Category;
ChartSeries bookCostSeries = new ChartSeries("Book Cost");
ChartDataBindModel bookCostModel = new ChartDataBindModel(bookCost);
bookCostModel.YNames = new string[] { "BookCost" };
bookCostSeries.SeriesModel = bookCostModel;
ChartSeries valueSeries = new ChartSeries("Current Valuation");
ChartDataBindModel valuationModel = new ChartDataBindModel(bookCost);
valuationModel.YNames = new string[] { "CurrentValuation" };
valueSeries.SeriesModel = valuationModel;
ChartDataBindAxisLabelModel dataLabelsModel = new ChartDataBindAxisLabelModel(bookCost);
dataLabelsModel.LabelName = "Fund";
currentFundValuesChart.Series.Add(bookCostSeries);
currentFundValuesChart.Series.Add(valueSeries);
currentFundValuesChart.PrimaryXAxis.LabelsImpl = dataLabelsModel;
The resulting chart is almost correct. The Book Cost and Current Valuation series display the correct values. However, 0-7 are displayed along the X axis instead of the Fund Name:

I'm not sure if my understanding of the basic concepts for the chart is incorrect.
- Does the ChartDAtaBindAxisLabelModel.LabelName need to match the property that contains the Categories? (FundName in this case)
- Does the PrimaryXAxis.VAlueType need to be set to ChartValueType.Category?
- Is there anything else that I'm overlooking? (I've run out of ideas at this point, but I suspect I'm probably overlooking something simple)