Jump to content
JChartFX Community
  • 0
Sign in to follow this  
niravbhatt

Completion of Plotting chart event

Question

niravbhatt    0

Hello,

 I am a licensed JChartFX user.

I am facing problem on shading charts/ making sections in chart when on very huge data. I want to shade chart after plotting entire chart. Temporary it is on time out but it is not good approch.

I want to ask that is there any event that I can get line plotChatCompleted or complete chart event so I can fire shading chart function.

 

Thanks in advance

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
JuanC    3

I am not entirely sure what you mean "fire shading chart function" but there is an event we fire after we are done generating the chart visuals,

chart1.on("render", onRenderEvent);

function onRenderEvent()
{
}

 

Hope this helps.

JuanC

Share this post


Link to post
Share on other sites
  • 0
niravbhatt    0

Thanks @JuanC

I saw comment #672 in forum. We need kind of that solution.
let me clear this way.

My requirements are,
1. Plotting a graph
2. Make some section according to some value and paint that section

We plotted a graph and made section in this way

chart1.create(document.getElementById("xychart" + xyChartData.widgetId));       
   //initialize rule builder  
  $timeout(function () {
      ApplyRuleBuilderOnBarLineUniversalAreaChart(chart1, xyChartData.widgetNumber);          
 }, 2000);

 

function ApplyRuleBuilderOnBarLineUniversalAreaChart(Chart1, widgetID) {

        section = new cfx.AxisSection();
        Chart1.getAxisY().getSections().add(section);
        section.setBackColor("#ffb2b2");
        if (ruleList[Index].compareType == 1) {
            section.setFrom(someNumber);
            section.setTo(MaxPosition);
        } else {
            section.setFrom(someNumber);
            section.setTo(0);
        }
        section.getGrids().getMajor().setVisible(false);
        section.getGrids().getMinor().setVisible(false);
        section.getGrids().getMinor().setTickMark(cfx.TickMark.None);
        section.getGrids().getMajor().setTickMark(cfx.TickMark.None);
        section.setTextColor("#ffb2b2")
        '
        '
        .
}

I always need to change timeout when chart plot late due to large data or network problem. Meanwhile ApplyRuleBuilderOnBarLineUniversalAreaChart this function execution has no meaning.
We want a event which confirms that chart plotting is completed and then we can execute function for create section to that particular chat.

Thanks in advance 

Share this post


Link to post
Share on other sites
  • 0
JuanC    3

Have you tried using the render event as I showed on my post? It should give you the feature that you need.

I do not understand why you cannot invoke the ApplyRuleBuilderOnBarLineUniversalAreaChart before the chart create call, the way you are doing it now the chart will be painted twice (one without the axis section and one with) and that may be visible to the user.

Is there a particular reason why you need to wait for the chart to be rendered to create the axis section?

But again, if that is what you need you should be able to use the render event.

Regards,

JuanC

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×