Jump to content
JChartFX Community
  • 0

Removing jQueryUI


o1webdawg

Question

 Hi Everyone,

 Our developers created all of our charts using the jQuery UI syntax.

 We are switching our UI framework and now I need to fix all of the broken charts to make them work without jQuery UI.

 We are still using jQuery, but just not the UI.

 

I am having a very hard time figuring out what part of our javascript is specific to jQuery UI.  

Can someone tell me how to re-write the following chart code to remove the parts relying on jQuery UI?

 

 

          $("#divname").chart({
            gallery: cfx.Gallery.Bar,
        titles: [{ text: "Monthly Sales - 2014"}],
        dataValues: monthlylist,
        axisY : {
          dataFormat: {
            format: cfx.AxisFormat.Currency
          },
          labelsFormat: {
            format: cfx.AxisFormat.Currency
          }
        },
        animations: {
          load: {
            enabled: true
          }
        }
          });

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

To create the chart you would do

var chart = new cfx.Chart();

// Configure chart here

chart.create("divname")

To configure the chart you have 2 choices, you can keep using json notation by using the setOptions method, e.g.

chart1.setOptions({ gallery: cfx.Gallery.Bar, ...

 Or you can use our API, e.g.

chart1.setGallery(cfx.Gallery.Bar);

chart1.getAllSeries().getPointLabels().setVisible(true);

JuanC 

Link to comment
Share on other sites

  • 0

 Thank you very much.  That got rid of the error.

 However, instead of a bar chart I got a line chart.

 

This is what I have now:

 

var chart = new cfx.Chart();
chart.create("<%=DivName%>")
chart1.setGallery(cfx.Gallery.Bar);
chart1.getAllSeries().getPointLabels().setVisible(true);

 

Why does this look entirely different without jQueryUI?  I expected it may not look exactly the same, but I thought it would at least be a bar chart.

Link to comment
Share on other sites

  • 0

If the variable for the chart you are creating is named chart, you need to change the setGallery and getAllSeries calls from chart1 to chart.

Also make sure the create call is the last call you make when creating the chart, to avoid painting the chart from than once.

For the chart to look the same as the jQueryUI counterpart you will have to add more api calls to configure the other settings you were changing using the json syntax. 

JuanC 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...