| Код | Chart1->Legend->Alignment = laBottom; // расположение легенды Chart1->Legend->Visible = true; // false; видимость легенды
Chart1->LeftAxis->SetMinMax( 0, 1001 ); // пределы на левой оси Chart1->LeftAxis->LabelsOnAxis = false; // показывать мин и макс Chart1->LeftAxis->Labels = true; // показывать метки
|
Есть такое событие OnGetAxisLabel, так вот в нем можно творить следующее:
| Код | //------------------------------------------------------------------------------ void __fastcall TСhart::GetAxisLabel(TChartAxis*Sender,TChartSeries*Series, int ValueIndex,String& LabelText) { if(!Sender->Horizontal) // только для оси абсцисс return; TDateTime d = CurrentDateTime; // расчеты, что выводить d=d-(double)(CurrentPoint-StrToFloat(LabelText))*DateTimeStep[dtOneSecond]; TDateTime LastTime=d-(int)d;
LabelText=LastTime; // выводить то, что в LastTime }
|
А перед этим можно настройки оси абсцисс выполнить
| Код | Chart1->BottomAxis->Labels = true; Chart1->BottomAxis->MinorTickLength = 0; Chart1->BottomAxis->TickOnLabelsOnly = 0; Chart1->BottomAxis->Automatic=false; Chart1->BottomAxis->AutomaticMaximum = false; Chart1->BottomAxis->AutomaticMinimum = false; Chart1->BottomAxis->RoundFirstLabel=false; Chart1->BottomAxis->LabelStyle=talValue; Chart1->BottomAxis->LabelsFont->Charset = DEFAULT_CHARSET; Chart1->BottomAxis->LabelsFont->Height = -10; Chart1->BottomAxis->LabelsFont->Style.Clear(); Chart1->BottomAxis->LabelsSize = 0; Chart1->BottomAxis->AxisValuesFormat="######0.#"; Chart1->BottomAxis->Ticks->Color = clBlack;
|
|