以前没用过DBCHART和CHART图表组件,今天需要用却发现好像这两个控件的X轴不能显示字符串,例如Series1.add(value1,value2)好像这两个值都不能显示字符串,那我只能显示数字,如果我要想X轴为字符串,也就是我想按商品名称为X轴,商品数量为Y轴来显示该怎样办呢?谢谢指教

解决方案 »

  1.   

    在Get开头的某个事件中添加代码
      

  2.   

    试试这个:
    Chart.BottomAxis.LabelStyle:=talText;
    找到帮助可以看到下面的信息
    其中的LabelStyle的定义如下
    TAxisLabelStyle = (talAuto,talNone,talValue,talMark,talText);
    TAxisLabelStyle defines the possible values of the TChartAxis.LabelStyle property.
    talAuto       Choose the Style automatically.
    talNone       No label. This will trigger the event with empty strings.
    talValue       Axis labeling is based on axis Minimum and Maximum properties.
    talMark       Each Series point will have a Label using SeriesMarks style.
    talText       Each Series point will have a Label using Series.XLabels strings.