Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

DocChart should support better way of building charts #61

Open
PrzemyslawKlys opened this issue Jun 4, 2021 · 0 comments
Open

DocChart should support better way of building charts #61

PrzemyslawKlys opened this issue Jun 4, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@PrzemyslawKlys
Copy link
Member

Import-Module .\PSWriteWord.psd1 -Force

$objChart = @(
    [PSCustomObject] @{ Type = 'Passed'; Count1 = 0 }
    [PSCustomObject] @{ Type = 'Failed'; Count1 = 3 }
    [PSCustomObject] @{ Type = 'Skipped'; Count1 = 0 }
)

Documentimo -FilePath $PSScriptRoot\Documentimo-BasicList.docx {
    DocToc -Title 'Table of content'

    DocNumbering -Text 'My document' -Level 0 -Type Numbered -Heading Heading1 {
        DocText -Text 'Test', ' Test2' -Color Yellow
        DocTable -DataTable $objChart -Design ColorfulGrid
    }
    DocNumbering -Text 'AnotherChart' {
        DocChart -Title 'Processes' -DataTable $objChart -Key 'Type' -Value 'Count' -LegendPosition Right
    }
    DocNumbering -Text 'AnotherChart' {
        DocChart -Title 'Processes' -DataTable $objChart -Key 'Type' -Value 'Count' -LegendPosition Right {
            DocChartBar -Name 'Passed' -Value 0
            DocChartBar -Name 'Failed' -Value 3
            DocChartBar -Name 'Skipped' -Value 0
        }
        DocChart -Title 'Processes' -DataTable $objChart -Key 'Type' -Value 'Count' -LegendPosition Right {
            foreach ($value in $objChart) {
                DocChartBar -Name $value.type -Value $value.count1
            }
        }
    }
} -Open
@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Jun 4, 2021
@PrzemyslawKlys PrzemyslawKlys self-assigned this Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant