Wednesday, June 26, 2013

[TeeChart] Add custom vertical/horizontal axis to a chart

// Create a new line series
  TLineSeries *Series = new TLineSeries(Chart);

// Create a new custom vertical axis
  TChartAxis *vertaxis = new TChartAxis(Chart);
// Assign custom vertical axis
  Series->CustomVertAxis = vertaxis;
// Set axis position
  vertaxis->PositionPercent = 0; //percentage
// Set axis size
  vertaxis->StartPosition = 10;  //percentage
  vertaxis->EndPosition   = 50;  //percentage

// Create a new custom horizontal axis
  TChartAxis *horiaxis = new TChartAxis(Chart);
// Set new axis as horizontal
  horiaxis->Horizontal = true;   
  
  Series->CustomHorizAxis = horiaxis;
  horiaxis->PositionPercent = 0;
  horiaxis->StartPosition   = 30;
  horiaxis->EndPosition     = 60;

// Add line series to chart
  Chart->AddSeries(Series);

No comments:

Post a Comment

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...