我正在 Framework7 中构建一个小型应用程序,使用 Chartist 来做一些图表。例如,我创建了一个 jsfiddle。你可以在这里看到它:https ://jsfiddle.net/emergingdzns/hpr6u8uk/1/
问题(如您在示例中所见)是垂直条上的长标签被切断。有什么办法可以解决吗?
这是javascript:
// Initialize your app
var myApp = new Framework7();
// Export selectors engine
var $$ = Dom7;
var dataChart1 = [
26400,
50500,
73200,
101100
];
new Chartist.Bar('#coveredChart', {
labels: ['1. Everyone has to have health insurance.',
'2. People can choose to have - or not have - health insurance.',
'3. People with pre-existing conditions are excluded.',
'4. Of those with health insurance, one becomes ill.'
],
series: [dataChart1]
});
这是HTML:
<div class="views">
<!-- Your main view, should have "view-main" class-->
<div class="view view-main">
<!-- Top Navbar-->
<div class="navbar">
<div class="navbar-inner">
<!-- We have home navbar without left link-->
<div class="center sliding">ClareFolio</div>
</div>
</div>
<!-- Pages, because we need fixed-through navbar and toolbar, it has additional appropriate classes-->
<div class="pages">
<!-- Page, data-page contains page name-->
<div data-page="covered" class="page">
<!-- Scrollable page content-->
<div class="page-content">
<br>
<div class="content-block-title" style="text-align:center;">Example chart below</div>
<div class="content-block">
<div class="content-block-inner">
<div class="chart">
<div id="coveredChart" class="ct-chart ct-golden-section"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>