Feature #1193

RCP: Charts engine, improve the scale and pan behavior in JFC charts engine

Added by Sebastien Jacquot almost 5 years ago. Updated 9 months ago.

Status:New Start date:12/12/2014
Priority:Normal Due date:
Assignee:- % Done:

50%

Category:Charts Spent time: -
Target version:TXM X.X

Description

Improve the scale and pan behavior in JFC charts engine.

2 problems:

  • #1 - zoom out puts blank space between axis and chart when the chart is reduced => is it really a problem ?
  • #2 - the scaling function with category chart (charts with labels and not numbers on X axis) only works on Y axis in JFC making this function almost useless

Solution 1

#1 - blank space
A simple way to keep axis stuck near the chart even if it's reduced is to play with the TickLabelInset while zooming/scaling. It may needs to extend the ChartPanel class and/or modify the JFC class MouseWheelHandler.
Eg. for changing the bottom label inset, should be called when scaling (and panning ?):

plot.getDomainAxis().setTickLabelInsets(new RectangleInsets(0, 0, 100, 0));

Other (better ?) way could be to redefine the behavior of XYPlot.zoomDomainAxes() or resizeRange() method of Axis.

Solution 2

#1 - blank space
When zooming out and the chart becomes smaller than the ChartPanel dimensions, switch to an "Image zoom" mode meaning that the axes unit ticks do not update themselves anymore and all entities are reduced (even label texts, titles, legends, etc.) as a raster image scaling.
When zooming in and the chart becomes bigger than the ChartPanel dimensions, restore the original JFC behavior.

Resolution

  • #2 - zoom on both axis X and Y
    I switched from category charts to XY charts for Partition dimensions and Specificities bar plot and line chart. I put some symbols instead of numeric values on X axis and implemented new renderers to manage the scaling and drawing of ticks and labels.

Validation test

  • create some partition dimensions bar plot, specificities bar plot ("Draw bars" preference) and specificities line chart ("Draw curve" preference)
  • see the behavior when zooming in, zooming out and panning
  • see the behavior when resizing the editor/tab
  • try on some large charts too because the new behavior hides some X axis labels to always make them readable

Related issues

related to Feature #1229: RCP: 0.7.7, improve zooming/scaling behavior in JFC chart... In Progress 01/14/2015

History

#1 Updated by Sebastien Jacquot almost 5 years ago

  • Description updated (diff)

#2 Updated by Sebastien Jacquot almost 5 years ago

  • Description updated (diff)
  • % Done changed from 0 to 50

#3 Updated by Sebastien Jacquot almost 5 years ago

  • Description updated (diff)

#4 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#5 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#6 Updated by Sebastien Jacquot over 4 years ago

  • Target version changed from TXM 0.7.7 to TXM 0.7.8

Moved to 0.7.8 because the scaling system can be enhanced, see point #1 of this issue.

#7 Updated by Matthieu Decorde about 4 years ago

  • Target version changed from TXM 0.7.8 to TXM 0.8.0a (split/restructuration)

#8 Updated by Sebastien Jacquot about 1 year ago

  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.8.0

#9 Updated by Sebastien Jacquot 9 months ago

  • Target version changed from TXM 0.8.0 to TXM X.X

Also available in: Atom PDF