使用Chart.js-X轴标签未全部显示

时间:2019-02-21 19:34:53

标签: javascript html chart.js

我将Chart.js用于饼图/条形图,在折线图和条形图上,由于某些原因,所有“ x”轴标签均未全部显示,但是在饼图中它们是:

**Image of all 3 graphs along side**

以下代码已被使用,而“类型”已针对我希望使用的图形类型进行了更改:

C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Web Deploy cannot modify the file 'MyApp.Functions.dll' on the destination because it is locked by an external process.  In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.) [C:\Github\2019AzureBlobLocalOnly\MyApp.Functions\MyApp.Functions.csproj]

1 个答案:

答案 0 :(得分:1)

我已经在Chart.js 2.0的小提琴中测试了您的代码,无论是条形还是线形,看起来都不错。图表中的x轴标签带有:

labels: ["Time Management", "Career Coach", "Stress & Wellbeing", "Note Taking", "Exam Prep", "Presentations"]

您无法看到全部的原因是宽度太细。您可以通过扩大宽度或将标签旋转为垂直来解决此问题。