The file minimal.json
contains:
{
"data": {
"labels": [
"GERMAN AMERICAN BANK",
"JOHNSON BANK",
"WASHINGTON TRUST BANK"
],
"datasets": [
{
"data": [
{
"y": 43.84,
"x": 51
},
{
"y": 47.02,
"x": 12
},
{
"y": 58.21,
"x": 53
}
],
"label": "data"
}
]
},
"options": {
"title": {
"text": "Banks",
"display": true
},
"scales": {
},
"plugins": {
"datalabels": {
"formatter": function(value, context) { var idx = context.dataIndex; return context.chart.data.labels[idx]; },
"display": true
}
}
},
"type": "scatter"
}
If I execute the following at a console:
@{ chart = Get-Content C:\temp\minimal.json -Raw } | ConvertTo-Json -Depth 100
The console appears to hang. It is unresponsive to C-c
.
Is this a bug in ConvertTo-Json
?
Any suggestions on how to get this example to work?