0

您好,我正在尝试使用chartdirectorvb.net 创建一个图表,我真正想做的是创建一个sub将图像作为对象类返回的图表,然后sub在我的页面中附加从 to image 标记返回的内容

这是我到目前为止所做的:

   Private Sub createChart(ByVal sender As System.Object, ByVal e As 
    _System.EventArgs)
    Dim cd As Integer = CreateObject("ChartDirector.API")
    Dim chart As XYChart = New XYChart(700, 170)
    Dim values As Double() = {25, 18, 15, 12, 8, 30, 35}
    Dim labels As String() = {"Labor", "Licenses", "Taxes", "Legal", 
    "Insurance", "Facilities", "Production"}
    chart.setPlotArea(30, 20, 200, 200)
    chart.addBarLayer(values)
    chart.xAxis().setLabels(labels)
    HttpContext.Current.Response.ContentType = "image/png"
    Dim mina As BinaryWriter = chart.makeChart2()
    HttpContext.Current.Response.End()

End Sub

这一行的代码中断

 Dim mina As BinaryWriter = chart.makeChart2()

出现以下错误Argument not specified for parameter format of public overridable function makechart2(format as integer ) As Byte()

任何想法如何解决这个问题都会很棒谢谢

4

1 回答 1

0

根据错误,makeChart2需要一个整数参数,而且它看起来也返回一个数组Byte,而不是一个BinaryWriter

我不熟悉chartdirector,所以我不知道是否有替代方案,或者您是否必须重构您的代码,但如果是后者,您需要 new up aBinaryWriterWrite返回值从makeChart2它。

于 2012-08-02T19:34:35.903 回答