How do you place content side by side? #319
Answered
by
PrzemyslawKlys
MartinGC94
asked this question in
Q&A
Replies: 1 comment 3 replies
-
$TestData = Get-ChildItem $PSHOME
$GroupedData = $TestData | Group-Object -Property Extension -NoElement
New-HTML -HtmlData {
New-HTMLSection -Direction column -HeaderTextAlignment left -CanCollapse -HeaderText FileData -Content {
New-HTMLSection -Content {
New-HTMLChart -Width 350 -Title FileExtensions -ChartSettings {
foreach ($Group in $GroupedData) {
New-ChartPie -Name $Group.Name -Value $Group.Count
}
}
New-HTMLTextBox -TextBlock {
New-HTMLText -Text "This is the first example of some demotext I want"
New-HTMLText -Text "This is the second example of some demotext I want"
New-HTMLText -Text "This is the third example of some demotext I want"
New-HTMLText -Text "This is the forth example of some demotext I want"
New-HTMLText -Text "This is the fifth example of some demotext I want"
}
}
New-HTMLTable -DataTable $TestData
}
} -ShowHTML I have just removed Direction from the 2nd section. $TestData = Get-ChildItem $PSHOME
$GroupedData = $TestData | Group-Object -Property Extension -NoElement
New-HTML -HtmlData {
New-HTMLSection -HeaderTextAlignment left -CanCollapse -HeaderText FileData -Content {
New-HTMLSection -Content {
New-HTMLChart -Width 350 -Title FileExtensions -ChartSettings {
foreach ($Group in $GroupedData) {
New-ChartPie -Name $Group.Name -Value $Group.Count
}
}
New-HTMLTextBox -TextBlock {
New-HTMLText -Text "This is the first example of some demotext I want"
New-HTMLText -Text "This is the second example of some demotext I want"
New-HTMLText -Text "This is the third example of some demotext I want"
New-HTMLText -Text "This is the forth example of some demotext I want"
New-HTMLText -Text "This is the fifth example of some demotext I want"
}
}
}
New-HTMLTable -DataTable $TestData
} -ShowHTML But to be honest I think you're overcomplicating it. By default the sections go from top to bottom. When you nest any sections they will go from left to right. So what I would usually do: $TestData = Get-ChildItem $PSHOME
$GroupedData = $TestData | Group-Object -Property Extension -NoElement
New-HTML -HtmlData {
New-HTMLSection -HeaderTextAlignment left -CanCollapse -HeaderText FileData -Content {
New-HTMLSection -Content {
New-HTMLChart -Width 350 -Title FileExtensions -ChartSettings {
foreach ($Group in $GroupedData) {
New-ChartPie -Name $Group.Name -Value $Group.Count
}
}
}
New-HTMLSection -Content {
New-HTMLTextBox -TextBlock {
New-HTMLText -Text "This is the first example of some demotext I want"
New-HTMLText -Text "This is the second example of some demotext I want"
New-HTMLText -Text "This is the third example of some demotext I want"
New-HTMLText -Text "This is the forth example of some demotext I want"
New-HTMLText -Text "This is the fifth example of some demotext I want"
}
}
}
New-HTMLSection -HeaderText 'next' {
New-HTMLTable -DataTable $TestData
}
} -ShowHTML And then I would usually add Invisible switch $TestData = Get-ChildItem $PSHOME
$GroupedData = $TestData | Group-Object -Property Extension -NoElement
New-HTML -HtmlData {
New-HTMLSection -HeaderTextAlignment left -CanCollapse -HeaderText FileData -Content {
New-HTMLSection -Content {
New-HTMLChart -Width 350 -Title FileExtensions -ChartSettings {
foreach ($Group in $GroupedData) {
New-ChartPie -Name $Group.Name -Value $Group.Count
}
}
} -Invisible
New-HTMLSection -Content {
New-HTMLTextBox -TextBlock {
New-HTMLText -Text "This is the first example of some demotext I want"
New-HTMLText -Text "This is the second example of some demotext I want"
New-HTMLText -Text "This is the third example of some demotext I want"
New-HTMLText -Text "This is the forth example of some demotext I want"
New-HTMLText -Text "This is the fifth example of some demotext I want"
}
} -Invisible
}
New-HTMLSection -HeaderText 'next' {
New-HTMLTable -DataTable $TestData
} -Invisible
} -ShowHTML |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
MartinGC94
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using this as a reference:
I want the text moved up on the right side of the labels for the pie chart. This is the code that I feel like should do it:
My understanding of the
Direction
parameter forNew-HTMLSection
is that column should add elements from top to bottom and row adds elements left to right, but clearly there's something I'm misunderstanding.I've tried wrapping the different elements in columns, panels, etc. and modifying the width and alignment properties but nothing I've done has worked for me.
Bonus question: Is there a way to modify the text for the pie chart labels? It would be nice if there was the raw number for each file extension so you didn't have to mouse over the chart to get the numbers.
Beta Was this translation helpful? Give feedback.
All reactions