You must be logged in to post your query.
Home › Forums › Chart Support › asp.net variable behind code
Tagged: behind code
Hi All, i would like to ask you if is possible to pass data to chrat from behind code. I tried change on of your example (hart-with-axis-scale-breaks.html). For example part with filling dollars
data: [{ type: "column", yValueFormatString: "$#,##0.00", dataPoints: [ { label: "USA", y: 42494 }, ] }]
i change it to this
data: [{ type: "column", yValueFormatString: "$#,##0.00", dataPoints: [ { label: "USA", y: '<%=dataUSA%>' }, ] }]
and in behind code is
Public Class yearlytemperature Inherits System.Web.UI.Page Public dataUSA As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then dataUSA = "42494" End If dataUSA = "42494" End Sub End Class
but nothing happens, when i will run code in debug mode i can see that variable passed into code but its not rendered :/
thank you for your help
BR
Antra
@antrac1t,
The data received using '<%=dataUSA%>' is of type String. Parsing it to int / float should work fine in your case. { label: "USA", y: parseFloat('<%=dataUSA%>') },
'<%=dataUSA%>'
{ label: "USA", y: parseFloat('<%=dataUSA%>') },
___________ Indranil Deo, Team CanvasJS
Dear Indranil Deo, wow your solution working thank you for your help
You must be logged in to reply to this topic. Login/Register