假如有1000个数据,如果一次读入,图会很密,很难看,能否一次读入这1000个数据后,通过设置chart中的参数来控制显示呢?虽然用控制读入数据的方法就能达到效果,但总是麻烦好多呀!有人用过吗?请赐教!

解决方案 »

  1.   

    可以控制啊,你想要现实多少块就现实多少块。
    比如你只需要现实10块数据
    vStrList 为先取得的1000条数据
          for i := 0 to vStrList.Count - 1 do
          begin
            if i < 10 then
              TPieSeries(AChart.Series[0]).AddPie('')//增加图形
            else
              Sum := Sum + Interger(vStrList.Objects[i]);
           end;
          if Sum > 0 then
            TPieSeries(AChart.Series[0]).AddPie(Sum, '其它', clTeeColor);
      

  2.   

    TChart有分页功能
    Chart1.MaxPointsPerPage := X 设置每页最大点数
      

  3.   

    回:zhaixing0101 Chart1.MaxPointsPerPage   :=   X   设置每页点数
    ---------------------------------------------------
    用这种方式,只是显示前头的数据:
    x=40,   显示1---40点我是希望显示后面的数据:961---1000, 还有没法吗?
      

  4.   

    Chart1.Page := X 这个属性, 负责当前显示第几页的数据,   (可以自己程序计算一下, 当前数据在第几页里)
    帮助里的说明
    Declaration
    property Page : LongInt;
    Description
    Run-time only.
    The Page property determines the current visible points of Series in a Chart with MaxPointsPerPage property greater than zero.
    When TChart.MaxPointsPerPage property is greater than zero, TeeChart internally divides all Series points in "pages".
    Each page is assigned a different initial and ending X coordinates.
    The TChart.NumPages property returns the total number of pages. It equals to the total number of Series points divided the MaxPointsPerPage property.The TChart.PreviousPage and TChart.NextPage methods decrement or increment the Page property respectively.