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

DocChart should support better way of building charts #61

@PrzemyslawKlys

Description

@PrzemyslawKlys
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

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions