FusionChart in VB.Net Windows Application
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



FusionChart in VB.Net Windows Application Expand / Collapse
Author
Message
Posted 11/30/2007 5:36:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/4/2007 8:38:26 PM
Posts: 6, Visits: 11
Hi all,
I'm new in FusionCharts and interested too use it in future application development, so right now i'm exploring FusionCharts features.
While there's A LOT sample to use FusionChart in ASP.Net WebApplication, I can't found any sample code to use it in VB.Net windows application.

I already to try to make a simple form that consist of 1 multiline textbox to writedown the xml string.
and already add FC As AxShockwaveFlashObjects.AxShockwaveFlash to this form
I use this XML String :







and use this code too render the chart :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGen.Click

FC.Movie = Application.StartupPath + "\\Column3d.swf"
FC.SetVariable("dataXML", TextBox1.Text)

FC.Play()
FC.Refresh()

End Sub

It's work fine if I run the form an click the button for the 1st time.
BUT.., when I want to render the chart again, i need too click the button 3 times before the chart generated again..
So., is it a bug in FusionCharts or it's just my fault?
I would appreciate any help for my case..
Post #3219
Posted 12/2/2007 11:37:08 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 1:19:54 AM
Posts: 870, Visits: 1,386
Hi,

Thanks for implementing FusionCharts in VB.NET Win App..and congrats..you have worked it out... to help you out a little ... can you please go through the sample C# Windows Application that we have posted here...

http://www.fusioncharts.com/forum/FindPost3221.aspx

You can easily convert it to VB.NET.

TO come to your query...yes there is a way out....rather 2....

1st.. core level...where you need to  rewind...setVariable and Tplay.. say if the object name is FC....

FC.Stop()
FC.Rewind()
FC.SetVariable("dataXML", strXML)
FC.TPlay(
"_root")

** This is applicable to FusionCharts vFree and v3 charts.

Thats it... or ...

2nd method : use CallFunction to call our charts;s externalINterface functions like ..setDataXML or setDataURL .

e.g.

FC.CallFunction("<invoke name=\""setDataXML"\"><arguments><string><chart><set value='10'/></chart></string></arguments></invoke>")

** this is ONLY Applicable to FusionCharts v3 Charts.

 



Regards,

Sudipto Choudhury
FusionCharts Team
Post #3220
Posted 12/3/2007 1:06:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/4/2007 8:38:26 PM
Posts: 6, Visits: 11
I tried ur 1st suggestion, and.... IT'S WORK...!!
Thanx a lot for your help

But i little bit curious for your second solution, i try this one :
FC.Movie = Application.StartupPath + "\\Column3d.swf"
FC.SetVariable("dataXML", TextBox1.Text)
FC.CallFunction("")

but there's an error when i run it, it come from the 3rd line:
Conversion from string "

I also already download your code and translate it to VB languange :

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
FC.Movie = (Application.StartupPath + "\\Column3d.swf")
FC.SetVariable("registerWithJS", "1")
FC.SetVariable("dataXML", textBox1.Text)
End Sub

Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim strXML As String = textBox1.Text
Dim args() As String = {strXML}
FC.CallFunction(FlashCall("setDataXML", args))
End Sub

Private Function FlashCall(ByVal fName As String, ByVal args() As String) As String
Return (" + (fName + ("\"">" _
+ (args(0) + "
"))))
End Function

But when i try to run it, there's an error occured from this code :
FC.CallFunction(FlashCall("setDataXML", args))

the error is :
Error HRESULT E_FAIL has been returned from a call to a COM component.

Would you give me a clue why it's happen in my code but not in yours
Post #3222
Posted 12/3/2007 3:24:41 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 1:19:54 AM
Posts: 870, Visits: 1,386
Hi,

As i have pointed out that CallFuction is not supported in FusionCharts FREE version charts.. It is applicable to v3 products...for this you will need to set a variable "registerWithJS" to "1" ..

you will find this in the code..

Regards,

Sudipto Choudhury
FusionCharts Team

Post #3223
Posted 12/3/2007 5:17:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/4/2007 8:38:26 PM
Posts: 6, Visits: 11
Ok, my bad..
Sorry I didn't notice that issue that callfunction unavailable in free version..

Thanx again..
Post #3224
Posted 1/30/2008 9:26:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/30/2008 9:59:59 AM
Posts: 1, Visits: 8
Hey there,

I'm using the same code but when I refresh XML data, some text and bars from previous graph is overlapping the new one. Please take a look attached image.

We are using Free version.

Thanks!!


  Post Attachments 
Image Overlapping.jpg (8 views, 15.76 KB)
Post #4251
Posted 1/31/2008 12:04:33 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 1:19:54 AM
Posts: 870, Visits: 1,386
hi,

There is another way of doing this. Keep the XML in String strXML and use the following code:

FC.SetVariable("_root.dataURL", "");

FC.SetVariable("_root.isNewData", "1");

FC.SetVariable("_root.newData", strXML);

FC.TGotoLabel("/", "JavaScriptHandler");



Regards,

Sudipto Choudhury
FusionCharts Team
Post #4270
« Prev Topic | Next Topic »


Permissions Expand / Collapse