Jump to content
Software FX Community

Incomplete display in Curve mode


Shady

Recommended Posts

Hi,

I am having some display issue when rendering a chart in curve mode: The line isn't painted in some cases. It seems the scale of the Y-axis is not well adjusted to draw the inferior part of the line.

Here is a simplified example that shows my problem:

import java.awt.Dimension;

import javax.swing.JFrame;

import com.softwarefx.chartfx.desktop.Chart;
import com.softwarefx.chartfx.desktop.Gallery;

public class Example {

  public static void main(String[] args) {
  Chart c = new Chart();
  double vals[] = { 0, 0, 0, 0, 0, 134.5, 269, 404 };
  c.getData().setPoints(vals.length);
  for(int i = 0; i < vals.length; i++) {
  c.getData().set(0, i, vals);
  }
  c.getData().setSeries(1);
  c.setGallery(Gallery.CURVE);

  JFrame frame = new JFrame();
  frame.getContentPane().add©;
  frame.setSize(new Dimension(800, 600));
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  }
}

In this example, the line between points 4 and 5 is not drawn on screen since inferior to the minimum (although the y-axis is left to adjust according to values).

Is there a way to make sure the curve line is always completely displayed on screen without having to force the minimum (since my values change dynamically)?

Thanks for your help,

Shady

 

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
Reply to this topic...

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

×
×
  • Create New...