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

Highcahrts export to table with multiple column types #7128

Closed
oyvindwh opened this Issue Sep 6, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@oyvindwh

oyvindwh commented Sep 6, 2017

Expected behaviour

When having different chart types in the same chart (see attachment for example) one of the serie is of type scatter, the other ones are of type column the get table returns this in separate lines. Would be better if these where on the same line as expected.

If possible it would be nice to have the value of the first column in the tabel, not from the x-axis title but from a setting in exporting-settings in the script before defaulting to the Category/Datetime. The default is hard to translate to other languages.

2017-09-06_08-44-39

Live demo with steps to reproduce

See live example => https://www.nbim.no/no/fondet/markedsverdi/ (second chart)
(the live example uses the github version, but we are soon moving to the Highchart version which has the same behavior. The screenshot is with the Highchart version.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 6, 2017

Collaborator

Thanks for reporting!

Simplified demo: http://jsfiddle.net/highcharts/f5wrh3uL/1/

Original demo moved to jsFiddle: http://jsfiddle.net/highcharts/ge4wovg3/

Collaborator

TorsteinHonsi commented Sep 6, 2017

Thanks for reporting!

Simplified demo: http://jsfiddle.net/highcharts/f5wrh3uL/1/

Original demo moved to jsFiddle: http://jsfiddle.net/highcharts/ge4wovg3/

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 6, 2017

Collaborator

Demo with the fix applied: http://jsfiddle.net/highcharts/ge4wovg3/2/

Collaborator

TorsteinHonsi commented Sep 6, 2017

Demo with the fix applied: http://jsfiddle.net/highcharts/ge4wovg3/2/

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Sep 6, 2017

Collaborator

Temporary workaround

The bug appears with scatter series. As a workaround, you can use a line series with lineWidth 0: http://jsfiddle.net/highcharts/ge4wovg3/3/

Collaborator

TorsteinHonsi commented Sep 6, 2017

Temporary workaround

The bug appears with scatter series. As a workaround, you can use a line series with lineWidth 0: http://jsfiddle.net/highcharts/ge4wovg3/3/

@oyvindwh

This comment has been minimized.

Show comment
Hide comment
@oyvindwh

oyvindwh Sep 6, 2017

I'll implement the workaround. Any possibilities for the first cell (DateTime/Category text) to get it localized from the exporting part of the script instead of the x-axis?

oyvindwh commented Sep 6, 2017

I'll implement the workaround. Any possibilities for the first cell (DateTime/Category text) to get it localized from the exporting part of the script instead of the x-axis?

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Sep 7, 2017

Contributor

Hi @oyvindwh

There are two options to change what is displayed in column headers:

  1. Set xAxis.title.text but that will also be displayed on the chart.

  2. Use exporting.csv.columnHeaderFormatter, for example:

            columnHeaderFormatter: function (item) {
              if (item instanceof Highcharts.Axis) {
                // axis
              	return 'My name';
              } else {
                // series
              	return item.name;
              }
            }

Demo

Contributor

pawelfus commented Sep 7, 2017

Hi @oyvindwh

There are two options to change what is displayed in column headers:

  1. Set xAxis.title.text but that will also be displayed on the chart.

  2. Use exporting.csv.columnHeaderFormatter, for example:

            columnHeaderFormatter: function (item) {
              if (item instanceof Highcharts.Axis) {
                // axis
              	return 'My name';
              } else {
                // series
              	return item.name;
              }
            }

Demo

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