Jump to content
JChartFX Community
  • 0

Two X axis


Question

Hello,

 I'm trying to paint a chart with two X axis. Both of them will be Date axis. In the first X-axis, I want to display hours with a certain step. In the second one, I want to display the month with another step.

How could I do this?

This is the code about the X-axis:

                        var axis = chart1.getAxisX();

axis.getLabelsFormat().setFormat(cfx.AxisFormat.Time);

axis.setStep(19);

axis.getLabelsFormat().setCustomFormat("HH:mm");

chart1.getAxisX().getGrids().setInterlaced(false);

 

                        var axisX2 = new cfx.AxisX();

 

chart1.getAxesX().add(axisX2);

axisX2.setVisible(true);

axisX2.getLabelsFormat().setFormat(cfx.AxisFormat.Time);

axisX2.getLabelsFormat().setCustomFormat("MM-dd");

axisX2.getGrids().setInterlaced(false);

            axisX2.getGrids().getMajor().setVisible(false);

        axisX2.setPosition(cfx.AxisPosition.Far);

        axisX2.setStyle(cfx.AxisStyles.Centered); 

 

I only get to display de first X axis. Why I cant display nothing in the second one?

 

Thanks 

  • Like 2
Link to post
Share on other sites

2 answers to this question

Recommended Posts

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