Posted by a ceTe Software moderator
Hello,
You are getting the error most likely because of using string object instead of a BarColumnValuePositionDataLabel object in the AddValue method. Please add only the series value and DateTime using AddValue method and then you can set the data label positions for the data points of the series using DataLabel property. Below is the code sample for it.
<!-- METADATA TYPE="typelib" UUID="DF9225FE-94A4-490d-8CAD-E8366CE621D3"-->
<%
' Create a PDF Document
Dim document
Set document = Server.CreateObject("DynamicPDF.Document")
' Create a Page and add it to the document
Dim MyPage
Set MyPage = document.AddPage()
' Create a chart
Dim Chart
Set Chart = MyPage.AddChart(0, 0, 400, 200)
' Create header titles and add it to the chart
Dim MyTitle1
Set MyTitle1 = Chart.AddHeaderTitle ("Website Visitors")
Dim MyTitle2
Set MyTitle2 = Chart.AddHeaderTitle ("Year - 2007")
' Create positions
Dim p0
p0 = DateSerial(2007, 1, 1)
Dim p1
p1 = DateSerial(2007, 2, 1)
Dim p2
p2 = DateSerial(2007, 3, 1)
Dim p3
p3 = DateSerial(2007, 4, 1)
' Create a date time column series and add value to it.
Dim MyColumnSeries1
Set MyColumnSeries1 = Chart.PrimaryPlotArea.AddDateTimeColumnSeries("Website A")
MyColumnSeries1.AddValue 5, p0
MyColumnSeries1.AddValue 7, p1
MyColumnSeries1.AddValue 4, p2
MyColumnSeries1.AddValue 3, p3
' Create a date time column series and add value to it.
Dim MyColumnSeries2
Set MyColumnSeries2 = Chart.PrimaryPlotArea.AddDateTimeColumnSeries("Website B")
MyColumnSeries2.AddValue 4, p0
MyColumnSeries2.AddValue 2, p1
MyColumnSeries2.AddValue 5, p2
MyColumnSeries2.AddValue 8, p3
' Create a date time column series and add value to it.
Dim MyColumnSeries3
Set MyColumnSeries3 = Chart.PrimaryPlotArea.AddDateTimeColumnSeries("Website C")
MyColumnSeries3.AddValue 2, p0
MyColumnSeries3.AddValue 4, p1
MyColumnSeries3.AddValue 6, p2
MyColumnSeries3.AddValue 9, p3
' Create a value position data label
Dim MyValuePositionDataLabel
Set MyValuePositionDataLabel = MyColumnSeries1.GetBarColumnValuePositionDataLabel(True)
MyColumnSeries1.DataLabel = MyValuePositionDataLabel
MyColumnSeries2.DataLabel = MyValuePositionDataLabel
MyColumnSeries3.DataLabel = MyValuePositionDataLabel
' Add a title to the yaxis
Dim MyTitle3
Set MyTitle3 = MyColumnSeries1.YAxis.AddTitle ("Viewers (in millions)")
' Set label list format for the axislabels
MyColumnSeries1.XAxis.LabelFormat = "MMM"
' Draw the PDF document
document.DrawToWeb
%>
Thanks,
ceTe Software Support Team.