Jump to content
JChartFX Community
  • 0

how to get reference to chart created with jquery


scisd

Question

I'm creating a pie chart and populating the data via jquery with ajax. this all works great but now I want to change the color of the chart, but I cant' figure out how to get a reference to the chart to call the functions. I can change "allSeries" but I want to change each series to a custom color. I create the chart like this:

 

 $("div", ".ChartDiv1").chart({

    gallery: cfx.Gallery.Pie,

    dataValues: items,

    //allSeries: { color: "#801702D1" },

    dataSourceSettings: {

        fields: [{

            name: "Open",

            usage: cfx.FieldUsage.Value

        }, {

            name: "Date",

            usage: cfx.FieldUsage.XValue

        }]

    },

    titles: [{

        text: "<%=ChartTitle %>"

    }]

});

so how do I get a reference to the chart so I can use setColor() function to change the series color? like this:

chart1.getAllSeries().getBorder().setColor("#FF0000");

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...