Opened 10 years ago

Closed 7 years ago

#16008 closed enhancement (patchwelcome)

Provide ability to position axis at different positions on a chart

Reported by: richyevans Owned by: cjolif
Priority: undecided Milestone: 1.13
Component: Charting Version: 1.8.0
Keywords: Cc: ben hockey
Blocked By: Blocking:


For instance if you look at the following discussion thread we have a requirement to have a zero x axis position:;cid=1347966612902-159

I'm sure that this would be of use for many other scenarios.

Attachments (2)

horizontalaxisreposition.diff (2.5 KB) - added by lee 10 years ago.
vCrossPoint diff
horizontalaxisreposition1.diff (3.1 KB) - added by lee 10 years ago.
horizontal and vertical axis mid point setting

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by cjolif

Owner: changed from Eugene Lazutkin to cjolif
Status: newassigned

comment:2 Changed 10 years ago by ben hockey

Cc: ben hockey added

comment:3 Changed 10 years ago by lee

I made an attempt at this a while ago and had it partially working but there's so much code in axis2d/Default.render() it's difficult to follow.

I'll pick it up again and submit a patch if it looks ok

Changed 10 years ago by lee

vCrossPoint diff

comment:4 Changed 10 years ago by lee

I've attached a patch which works for the small number of use cases I've tried, uhop mentioned I'd need to take care of the chart height and offsets however this seems to work (along with the #15925 changes). I doubt it's this straight forward

I've added a new property vCrossPoint, when set it'll reposition the horizontal axis to whatever value set, when not set it'll use the default behaviour

comment:5 Changed 10 years ago by cjolif

bod, thanks, yes the patch might need to be improved. In particular it should certainly work both vertically & horizontally as well as adjusting the chart size. By the way do you have a Dojo CLA on file? I can't find you here: This is required for your contributions to end up in Dojo.

comment:6 Changed 10 years ago by lee

I'd thought vertical axis positioning would be useful too so i'll have a look. I'm not sure I follow what do you mean regarding adjusting the chart size? I should be on the clas, my name's on it (bodzak) but it's not recognising the email I use for here

Changed 10 years ago by lee

horizontal and vertical axis mid point setting

comment:7 Changed 10 years ago by lee

I've added the vertical axis repositioning, though I reckon I can reduce the bloat further I don't think it needs 2 methods to calculate roughly the same thing.

I'm still not sure this is all it takes so I need to apply this to existing tests to make sure I'm not missing more work I need to do. My diffs look fine in vim but look dodgy when I upload to trac, I'll fix them if needed. cjolif, can you give me more info what you said re chart resizing? Thanks for the help

Version 0, edited 10 years ago by lee (next)

comment:8 Changed 10 years ago by cjolif

bod, by chart resizing, I mean that when computing the size of the Chart (see for example Chart.fullGeometry) we are removing the size of the axis to compute the area available to plot. Obviously if axis are in the middle of the plot area this should be changed.

comment:9 Changed 7 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 3+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.