Hello i was trying to create a chart using chartdirector and vb.net
what i exactly trying to do is create a sub that returns an image as object class and then append what ever return from the sub to image tag in my page
Here is what i have done so far :
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
the code break at this line
Dim mina As BinaryWriter = chart.makeChart2()
with the following error Argument not specified for parameter format of public overridable function makechart2(format as integer ) As Byte()
any idea how to fix this will be great
Thanks
According to the error,
makeChart2requires an integer parameter, and it also looks like it returns an array ofByte, not aBinaryWriter.I’m not familiar with
chartdirector, so I don’t know if there is an alternative, or if you’ll have to refactor your code, but if it is the latter, you’ll need to new up aBinaryWriter, andWritethe return value frommakeChart2to it.