问题描述
我在TDBChart中有一个TLineseries。我在Y轴上有汽车的价格,在X轴上有汽车的价格。每个点都有一个标有汽车品牌的商标。但是,当我显示它们时,标签重叠并且难以阅读。如果鼠标光标悬停在标签上方,该如何将标签贴到前面?
我已经看到,当光标悬停在标签上时,颜色会发生变化,这使我相信可以做到这一点。 否则,可以隐藏所有标签,但是当鼠标悬停在标签上时才显示一个标签吗?
图片:
光标悬停在标签上:
光标未悬停在标签上:
到目前为止,我的系列的代码:
// draw graph
with dbChart1 do
begin
ClearChart;
View3D := false;
AddSeries(TLineseries.create(self));
(Series[0] as TLineseries).ColorEachPoint := true;
CarOwners.tbl_Cars.disableControls;
with CarOwners do
begin
SavePlace := tbl_Cars.GetBookmark;
tbl_Cars.first;
while not tbl_Cars.eof do
begin
Series[0].AddY(tbl_Cars['Price'],tbl_Cars['Make'],clTeeColor);
tbl_Cars.next;
end;
tbl_Cars.GotoBookmark(SavePlace);
tbl_Cars.FreeBookmark(SavePlace);
tbl_Cars.EnableControls;
end;
(Series[0] as TLineseries).Pointer.Visible := true;
(Series[0] as TLineseries).Pointer.Style := psCircle;
(Series[0] as TLineseries).LinePen.Width := 3;
(Series[0] as TLineseries).Marks.Visible := true;
(Series[0] as TLineseries).Marks.DrawEvery := 1;
(Series[0] as TLineseries).Marks.Autoposition := false;
(series[0] as tlineseries).Marks.Color := clBlack;
(series[0] as tlineseries).marks.Font.Color := clWhite;
end;
// calculate and add possible values after
with dbChart1 do
begin
if chbl1_Stat_Values.Checked[0] then
begin
AddSeries(TFastLineseries.create(self));
(Series[1] as TFastLineseries)
.SetFunction(THighTeeFunction.create(self));
(Series[1] as TFastLineseries).DataSource := Series[0];
(Series[1] as TFastLineseries).SeriesColor := clRed;
end;
end;
dbChart1.ColorPaletteIndex := 10;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)