Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left justify chart, with a margin on right side #857

Closed
orwant opened this issue May 9, 2015 · 6 comments
Closed

Left justify chart, with a margin on right side #857

orwant opened this issue May 9, 2015 · 6 comments

Comments

@orwant
Copy link
Collaborator

orwant commented May 9, 2015

What would you like to see us add to this API?

Hi guys, unless I am missing something obvious (I've searched), there is no option
for setting a chart to be left justified with a right margin.  This is a common need
for charts with legends that are set to 'right', especially with multi-series line
charts.


What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?

LineChart (really all charts).


*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by sean.power@karmadata.com on 2012-03-20 22:48:45

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

The 'chartArea' option.

Original issue reported on code.google.com by jinji.viz on 2012-03-21 11:00:53

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

Hi jinji, thanks.  At the risk of being pedantic, I don't believe the left justified
with a right margin is available in chartArea.  Check out these two charts on my site:

bar chart with chart area settings of: chartArea': {width: '80%', height: '80%', left:
250}
http://www.karmadata.com/View/Chart?viewid=051655365DEF4225B58BD00E6881618E


line chart with chartArea settings of:  chartArea': {width: '80%', height: '80%', right:
250}
http://www.karmadata.com/View/Chart?viewid=2C48A203ED9940A09EA8FF6252A0365F

what is the syntax in chartArea to get a left justified (not centered...the 80% just
centers the chart in the containing div btw) with a right margin (to hold the legend,
allow the legend text to be at least 250 pixels long).

Also, auto left and right margins for the chart container that grow and shrink based
on the axis labels and/or legend text, would be great.

thanks!

Original issue reported on code.google.com by sean.power@karmadata.com on 2012-03-21 14:10:37

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

i was being pedantic (sort of).  the chartArea option for a left justified (not centered)
is:

chartArea': {width: '70%', height: '80%', left: 80}

you need a left property in order for the chart to left justify.  However, I am still
confused on how to right justify a chart within the container.... also confused on
how to auto-margin based on length of axis or legend texts to the left or right of
c hart...

Original issue reported on code.google.com by sean.power@karmadata.com on 2012-03-21 14:20:25

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

I can't see your charts as I need to login (and I don't want to), so I'll try to answer
hoping that I understand you.

In general, the chart occupies the entire div you give it. That area is divided into
the central main "charArea", and the margins (to accommodate the legend and such).
The "chartArea" option controls this part.

Regrading your last sentence, that's a feature that's not yet supported, sorry (not
that I argue about its usefulness).

Original issue reported on code.google.com by jinji.viz on 2012-03-21 14:21:59

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

More things you can try:
chartArea: {width: '70%', left: 0} (left)
chartArea: {width: '70%', left: '30%'} (right)

Original issue reported on code.google.com by jinji.viz on 2012-03-21 14:24:47

@orwant
Copy link
Collaborator Author

orwant commented May 9, 2015

:-) I'm going to have to work to gain your trust.

i'll try the left: '30%' trick.

Original issue reported on code.google.com by sean.power@karmadata.com on 2012-03-21 14:38:48

@orwant orwant closed this as completed May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant