Skip to content
New issue

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

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

Already on GitHub? # to your account

Add an option to change chart tick mark type #473

Closed
wants to merge 1 commit into from

Conversation

RokasDie
Copy link

@RokasDie RokasDie commented Jan 13, 2019

Hello,

One of the feature which I saw was missing is to change the minor and major tick mark position for charts. For example: whether the tick marks should be inside, outside or cross axis.

Sadly, I am fairly new to development and Github in general, so I do not know how to update the documentation. Readme.md seemed only to have links to the "Adding Charts" page. So any tips or help on how to do that would be really helpful.

Regards,
Rokas

Hello,

One of the feature which I saw was missing is to change the minor and major tick mark position for charts. For example: whether the tick marks should be inside, outside or cross axis
@gitbrent
Copy link
Owner

Hi @RokasDie

Thanks for the contribution. The docs are in a different branch, so no worries there.

Can you provide demo code and output for the new types you've added so I can validate that they function correctly?

Check examples/pptxgenjs-demo.js for loads of chart demo code you can use as a basis for a couple of examples.

@RokasDie
Copy link
Author

RokasDie commented Jan 15, 2019

Hello, @gitbrent

Please see some results of my testing with the changed branch:
tickMarksCross.pptx
tickMarksOutside.pptx
tickMarksInside.pptx
tickMarksNone.pptx

I also attach the code which was used:

var PptxGenJS = require("pptxgenjs");

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

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]
    }
];

// TOP-LEFT: H/bar
var optsChartBar1 = { x:0.5, y:0.6, w:6.0, h:3.0,
    barDir: 'bar',
    border: { pt:'3', color:'00EE00' },
    fill: 'F1F1F1',

    catAxisLabelColor   : 'CC0000',
    catAxisLabelFontFace: 'Helvetica Neue',
    catAxisLabelFontSize: 14,
    catAxisOrientation  : 'maxMin',

    titleColor   : '33CF22',
    titleFontFace: 'Helvetica Neue',
    titleFontSize: 24,
    // commands: "in", "out", "cross", "none"
    valAxisMinorUnitType: "none",
    valAxisMajorUnitType: "none"
};
slide.addChart( pptx.charts.BAR, arrDataRegions, optsChartBar1 );

pptx.save('./PowerPoints/testing.pptx');

Please tell me if something else needs to be checked.

Regards,
Rokas

@gitbrent gitbrent added this to the 3.0.0 milestone Sep 12, 2019
@gitbrent gitbrent self-requested a review September 12, 2019 03:02
gitbrent added a commit that referenced this pull request Sep 12, 2019
@gitbrent
Copy link
Owner

Thanks @RokasDie !

This has been added to the 3.0 codebase.

@gitbrent gitbrent closed this Sep 12, 2019
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this pull request Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this pull request Mar 24, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants