I'm working with a TDBChart and a TFDQuery as a DataSource with three data fields: Date, Amount and ItemName. I'm using C++ Builder 11 and FMX.
I'm trying to make a Bar chart with Date on the XValue, Amount on YValue, and I want the ItemName as XLabel, but I didn't found the way to do that.
The chart always shows the Value or the Label as XLabelSource. To show the ItemName I'm trying with OnGetMarkText event handler, but I don't know how to access the ItemName inside the event handler. This is the code that I'm testing:
.h code
----------
Code: Select all
void __fastcall DefinicionMarcasSeriesCLP(TChartSeries *Sender, int ValueIndex, UnicodeString &MarkText);
-------------
Code: Select all
void __fastcall TForm_GraficosFlujoCaja::FormShow(TObject *Sender)
{
TChartSeries *SerieFlujoCajaCLP = DBChart_FlujoCaja->Series[0];
SerieFlujoCajaCLP->OnGetMarkText = DefinicionMarcasSeriesCLP;
}
void __fastcall TForm_GraficosFlujoCaja::DefinicionMarcasSeriesCLP(TChartSeries *Sender, int ValueIndex, UnicodeString &MarkText)
{
if(Sender != NULL && ValueIndex > -1) {
MarkText = IntToStr(ValueIndex); // Here I want the ItemName: How could do it?
}
}
Best regards,
Patricio Cerda