feat: support alignment translation of axis#30
feat: support alignment translation of axis#30yyonghe wants to merge 2 commits intovdobler:masterfrom
Conversation
|
Thanks for this feature!
From reading the commit message and the code it seems as if this change allows to put the axis "on the other" side (right side of plot for Y-axis and top of plot for the X-axis). Is this correct? |
| Data2Screen func(float64) int // Function to map data value to screen position | ||
| Screen2Data func(int) float64 // Inverse of Data2Screen | ||
|
|
||
| AlignTrans bool // alignment translation of the axis: false: axis location left/bottom, true: axis location right/top |
There was a problem hiding this comment.
AlignTrans is not a clear name. I would prefer something like SwitchSide or AlternateSide or something else but it is not just a translation, and not really an alignment.
For the comment: Start with a capital letter.
Maybe
SwitchSide bool // Switch location of axis to top / right if true.
| // Plot outputs the scatter chart to the graphic output g. | ||
| func (c *ScatterChart) Plot(g Graphics) { | ||
| layout := layout(g, c.Title, c.XRange.Label, c.YRange.Label, | ||
| layout := layoutWithAlign(g, c.Title, c.XRange.Label, c.YRange.Label, |
There was a problem hiding this comment.
Why is scatterplot the only one which calls layoutWithAlign?
Location Y axis to right.