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

Option to Set Show Data Table through code #182

Closed
akashkarpe opened this issue Sep 11, 2017 · 4 comments
Closed

Option to Set Show Data Table through code #182

akashkarpe opened this issue Sep 11, 2017 · 4 comments
Assignees
Milestone

Comments

@akashkarpe
Copy link

Hi ,
Thanks for creating this library.
It would be nice if we have option set Show Data Table flag ,so that when I open PPT I can see graph with Data Table.

@akashkarpe akashkarpe changed the title Option Set Show Data Table through code Option to Set Show Data Table through code Sep 11, 2017
@gitbrent
Copy link
Owner

Hi @akashkarpe ,

I'm not clear on what you're asking for. Viewing the data behind a table is done via the Ribbon (see below - "Edit Data in Excel"), i'm not sure there's something i can set that will open/show the data.

screen shot 2017-09-11 at 19 41 37

@akashkarpe
Copy link
Author

akashkarpe commented Sep 12, 2017

Hi @gitbrent , thanks for quick reply.
I understood your point.
But our need is different .
We want Data Table Property in CHART ELEMENT by default checked or we should able to set it from code. Please see following screenshot
datatableoption

We are expecting output like below when user open's PPT for first time.
graphwithdata

@gitbrent gitbrent self-assigned this Sep 13, 2017
@gitbrent gitbrent added this to the 1.9.0 milestone Sep 16, 2017
@gitbrent
Copy link
Owner

Hi @akashkarpe ,

The ability to show Data Table has been implemented. I also added the same 4 Data Table options found in PowerPoint.

Check the README for all the new chart options

Ex:

var pptx = new PptxGenJS();
var slide = pptx.addNewSlide();

var arrDataRegions = [
  {
    name  : 'Region 1',
    labels: ['May', 'June', 'July', 'August'],
    values: [26, 53, 100, 75]
  },
  {
    name  : 'Region 2',
    labels: ['May', 'June', 'July', 'August'],
    values: [43.5, 70.3, 90.1, 80.05]
  }
];

var optsChartBar1 = { x:0.5, y:0.6, w:6.0, h:3.0,
  barDir:                  'bar',
  showDataTable:           true,
  showDataTableKeys:       true,
  showDataTableHorzBorder: true,
  showDataTableVertBorder: true,
  showDataTableOutline:    true
};
slide.addChart( pptx.charts.BAR, arrDataRegions, optsChartBar1 );

pptx.save('PptxGenJS-Data Table');

Result:
screen shot 2017-09-16 at 19 30 28

@akashkarpe
Copy link
Author

@gitbrent ,Thanks a lot, this will definitely solve our problem.

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

2 participants