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

If 1st "data" array is empty then chart doesn't render #284

Open
n8-mills opened this issue Oct 29, 2021 · 1 comment
Open

If 1st "data" array is empty then chart doesn't render #284

n8-mills opened this issue Oct 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@n8-mills
Copy link

n8-mills commented Oct 29, 2021

If 1st "data" array is empty then chart doesn't render correctly

New-HTML -TitleText 'My title' -Online -FilePath $PSScriptRoot\Example-ChartsBarStacked.html {
    New-HTMLTabStyle -SlimTabs
    New-HTMLTab -Name 'Bar Charts - Bar Stacked' -IconSolid audio-description {
        New-HTMLSection -HeaderText 'Bar Charts - Stacked' -CanCollapse {
            New-HTMLPanel {
                #$Data1 = 44, 55, 0, 0, 22, 43, 21
                $Data1 =  , , , , , ,
                $Data2 = 53, 32, 33, 52, 13, 43, 32
                $Data3 = 12, 17, 11, 9, , , 20
                $Data4 = 9, 7, 5, 8, 6, 9, 4
                $Data5 = 25, 12, 19, 32, , , 10
                $DataNames1 = 2008, 2009, 2010, 2011, 2012, 2013, 2014
                New-HTMLChart -Title 'Finctional Books Sales' {
                    New-ChartBarOptions -Type barStacked
                    New-ChartLegend -Names 'Marine Sprite', 'Striking Calf', 'Tank Picture', 'Tank Picture', 'Bucket Slope', 'Reborn Kid', 'Other' -LegendPosition top
                    for ($i = 0; $i -lt $Data1.Count; $i++) {
                        New-ChartBar -Name $DataNames1[$i] -Value $Data1[$i], $Data2[$i], $Data3[$i], $Data4[$i], $Data5[$i]
                    }
                }
            }
        }
    }

} -Show
@PrzemyslawKlys PrzemyslawKlys added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels Oct 31, 2021
@StartAutomating
Copy link

@PrzemyslawKlys I think this one would be fairly straightforward... just checking for "null burps" within a collection.

I'll take it if you want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants