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

Change series label on line charts #46

Closed
mpena2099 opened this Issue Dec 11, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@mpena2099
Contributor

mpena2099 commented Dec 11, 2016

Hi! In the example:

cht = Chart(
        datasource = ds, 
        series_options = 
          [{'options':{
              'type': 'line',
              'stacking': False},
            'terms':{
              'month': [
                'boston_temp',
                'houston_temp']
              }}],
        chart_options = 
          {'title': {
               'text': 'Weather Data of Boston and Houston'},
           'xAxis': {
                'title': {
                   'text': 'Month number'}}})

How could I change the series name? I do not want to use "Boston Temp" and "Houston Temp" automatically...

Thanks!
Mauricio

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Dec 14, 2016

Contributor

@mpena2099 consider the following diff if you'd like to rename the term.

diff --git a/demoproject/demoproject/chartdemo.py b/demoproject/demoproject/chartdemo.py
index 3367376..d74b742 100755
--- a/demoproject/demoproject/chartdemo.py
+++ b/demoproject/demoproject/chartdemo.py
@@ -31,7 +31,7 @@ def basicline(_, title, code, doc, sidebar_items):
                 },
                 'terms': [
                     'month',
-                    'houston_temp',
+                    {'Temperature in Houston': 'houston_temp'},
                     'boston_temp'
                 ]
             }]
@@ -47,7 +47,7 @@ def basicline(_, title, code, doc, sidebar_items):
                 'terms': {
                     'month': [
                         'boston_temp',
-                        'houston_temp'
+                        'Temperature in Houston'
                     ]
                 }
             }],

This is partially documented in DataPool.__init__ but a more robust example has not been given. I'm leaving this issue open as a reminder to update the docs.

Contributor

atodorov commented Dec 14, 2016

@mpena2099 consider the following diff if you'd like to rename the term.

diff --git a/demoproject/demoproject/chartdemo.py b/demoproject/demoproject/chartdemo.py
index 3367376..d74b742 100755
--- a/demoproject/demoproject/chartdemo.py
+++ b/demoproject/demoproject/chartdemo.py
@@ -31,7 +31,7 @@ def basicline(_, title, code, doc, sidebar_items):
                 },
                 'terms': [
                     'month',
-                    'houston_temp',
+                    {'Temperature in Houston': 'houston_temp'},
                     'boston_temp'
                 ]
             }]
@@ -47,7 +47,7 @@ def basicline(_, title, code, doc, sidebar_items):
                 'terms': {
                     'month': [
                         'boston_temp',
-                        'houston_temp'
+                        'Temperature in Houston'
                     ]
                 }
             }],

This is partially documented in DataPool.__init__ but a more robust example has not been given. I'm leaving this issue open as a reminder to update the docs.

@atodorov atodorov added the docs label Dec 14, 2016

@mpena2099

This comment has been minimized.

Show comment
Hide comment
@mpena2099

mpena2099 Dec 14, 2016

Contributor

OK, it worked. Thanks!

Contributor

mpena2099 commented Dec 14, 2016

OK, it worked. Thanks!

@atodorov atodorov closed this in 6ba5040 Mar 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment