使用mschart控件显示二维柱状图,请问如何在柱状图顶端将数值一同显示出来?

解决方案 »

  1.   

    用teechart图形控件吧,这个很容易做到
      

  2.   

    MSCHART有这个属性的。你试试改属性吧。很容易就试出来了……我这里没有VB,具体属性名我忘了。
      

  3.   

    With MSChart1
        .Backdrop.Fill.Style = VtFillStyleBrush
        .ColumnCount = 1
        .RowCount = UBound(Y, 1) + 1
        .Row = 1
        For I = 1 To .RowCount
          .Row = I
          .RowLabel = Format(Y(I - 1, 0), "mm/dd/yy")
        Next I
        .Backdrop.Fill.Style = VtFillStyleBrush
        .Column = 1
        .Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeOutside
        .Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.ValueFormat = "#0.00"
        .Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.Custom = True
        .Plot.SubPlotLabelPosition = VtChSubPlotLabelLocationTypeAbove
        For I = 1 To .RowCount
          .Row = I
          .Data = Y(I - 1, 1)
          Call .Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.ResetCustomLabel    
        Next I
      End With在数组Y是一个二维数组(日期,数据)
    你可以用你自己的的数组代替。
    .Plot.SeriesCollection(1).DataPoints(-1).DataPointLabel.LocationType = VtChLabelLocationTypeOutside这句是用来显示数据点标签的。