简体   繁体   English

RetinaJs和jChartFX组合不起作用

[英]RetinaJs and jChartFX combination not working

I'm using jChartFX for some charting requirements for my website, I'm using 我将jChartFX用于网站的某些图表要求,

<?php include $_SERVER["DOCUMENT_ROOT"].'/footer.php' ?>

to bring in a footer to the website which has a line of code in it of 将页脚带到网站上,其中包含一行代码

<script type="text/javascript" src="/js/retina.js"></script>

Which for some reason is making the chart not show for jChartFX. 由于某种原因,jChartFX的图表无法显示。 I have been through the process of commenting out the various sections of footer in order to isolate this being the incompatibility. 我一直在注释掉页脚的各个部分,以隔离这种不兼容的过程。

Note: I've not included the full page code to save on space, but can reply with full code if required. 注意:我没有提供完整的页面代码以节省空间,但是可以根据需要提供完整的代码。

The chart is displayed through; 图表显示通过;

<div id="ChartDiv" style="width:600px;height:400px"></div> <script type="text/javascript" language="javascript">

var chart1;

function loadChart()

  {        

       chart1 = new cfx.Chart();

        <!-- chart1.getData().setSeries(2); -->
        chart1.getData().setSeries(1);

        chart1.getAxisY().setMin(100);

        chart1.getAxisY().setMax(1000);

        var series1 = chart1.getSeries().getItem(0);

        <!-- var series2 = chart1.getSeries().getItem(1); -->

        series1.setGallery(cfx.Gallery.Lines);

        <!-- series2.setGallery(cfx.Gallery.Bar); -->

        var data = <?php echo json_encode($temp, JSON_NUMERIC_CHECK); ?>;

        chart1.setDataSource(data);

        var divHolder = document.getElementById('ChartDiv');

    chart1.create(divHolder);            

  }

To be honest, I'm at a complete loss so any / all help would be appreciated. 老实说,我完全不知所措,因此任何/所有帮助将不胜感激。

Thanks Maudise 感谢Maudise

I added retina.js to some of our jChartFX test pages and they displayed fine. 我在我们的某些jChartFX测试页面中添加了retina.js,它们显示良好。 There might be something else you are including in the page when you generate your footer. 生成页脚时,页面中可能还包含其他内容。

I did not check too deep into retina.js but it seems to check for img tags and try to replace with retina counterparts and jChartFX does not use img tags. 我没有对retina.js进行过深入的检查,但似乎要检查img标签并尝试用视网膜对应标签替换,并且jChartFX不使用img标签。

Regards, 问候,

JuanC 胡安

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM