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

Scatter chart doesn't use name to name series #41

Open
moovida opened this issue Jun 4, 2018 · 4 comments
Open

Scatter chart doesn't use name to name series #41

moovida opened this issue Jun 4, 2018 · 4 comments

Comments

@moovida
Copy link

moovida commented Jun 4, 2018

It seems that Scatter charts do not use name for the series. Instead in the legend always Values appears.

Also, legend: 'false' in the opts doesn't hide the legend.

@jericks
Copy link
Member

jericks commented Jun 7, 2018

I just added a dataLabel property to Scatter plots so you can change it from Values,

e5089d0

but the legend property seems to be working:

https://jericks.github.io/geoscript-groovy-cookbook/#creating-scatter-plot-charts

Keep the feedback coming!

@moovida
Copy link
Author

moovida commented Jun 7, 2018

Thank you!

I made a small test script to describe a few little issues:

def max = 100
def chart1Data = []
for(i in 1..max){
    chart1Data << [i, Math.pow(i, 2.0)]
}
def opts1 = [
    title: 'Chart1',
    name: 'Pow2',
    xLabel: 'X Values',
    yLabel: 'Y Values',
    legend: 'true',
    tooltips: 'true',
    smooth: 'true']
def chart1 = Curve.curve(opts1, chart1Data)

def chart2Data = []
for(i in 1..max){
    if(i % 10 == 0 )
        chart2Data << [i, i*50.0]
}
def opts2 = [
    title: 'Chart2',
    name: 'y = x * 50',
    xLabel: 'X Values',
    yLabel: 'Y Values',
    legend: 'true',
    tooltips: 'true',
    smooth: 'true']
def chart2 = Scatter.scatterplot(opts2, chart2Data)
chart1.overlay([chart2])
chart1.show()

The result is this:

chart_problem

Ignore the wrong legend (Values), since that is what you already fixed, but I have the old lib.

Problems:

  1. the y axis added to the right for the second series is wrong. It seems to ba a version of the left y axis, but scaled by 10000) . But the data are in the same scale of the first data. If I add other overlays, the same happens for any newly added axis.
  2. if I put the legend property to false in the opts1 and opts2, the legend doesn't disappear.

It would be great to be able to avoid y axes addition at the right.

Thanks!

@jericks
Copy link
Member

jericks commented Jun 8, 2018

Hmm, I think I see one of the issues, legend, tooltips, and smooth should be booleans not strings.

@moovida
Copy link
Author

moovida commented Apr 6, 2019

Just on a sidenote, changing the above to boolean doesn't solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants