Using ML 8, I’m setting up a little profiling web application and I need to do 
visualization on the recorded data, e.g., durations reported by query meters 
for a large number operations.

I’m following the guidance in the Search Developer's Guide — Chapter 31, Data 
Visualization Widgets, in the context of my own simple Web app (that is, I did 
not use the application builder to initially create my app, I just created a 
simple HTTP app from scratch.

I’m generating an HTML page that includes all the Javascript for visualization:

    <script src="/appbuilder/lib/external/jquery-1.7.1.min.js" 
type="text/javascript"></script>
    <script src="/appbuilder/lib/external/highcharts.src.js" 
type="text/javascript"></script>
    <!-- Visualization widget scripts -->
    <script src="/appbuilder/lib/controller.js" type="text/javascript"></script>
    <script src="/appbuilder/lib/widget.js" type="text/javascript"></script>
    <script src="/appbuilder/lib/viz/chart/chart.js" 
type="text/javascript"></script>
    <script type="text/javascript">
        var durationBarChartConfig = {
title: "Duration Distributions",
            dataLabel: "Durations",
            dataType: "int"
        }
        ML.controller.init();
        ML.chartWidget('duration-bar-chart-1', 'bar', durationBarChartConfig); 
ML.chartWidget('duration-bar-chart-2', 'bar', durationBarChartConfig); 
ML.chartWidget('duration-bar-chart-3', 'bar', durationBarChartConfig);
        
        ML.controller.loadData();
        </script>

And in the main HTML I’m generating the corresponding widget-containing divs:

   <td>
      <div id="duration-bar-chart-1" class="widget"></div>
    </td>

However, when I load the page I get this result in the console:

chart.js:82 Uncaught Chart widget container ID "duration-bar-chart-1" does not 
exist

The element exists and there are no other errors in the JS console.

I assume I must be missing something basic here but as I’m not at all versed in 
JavaScript I’m hoping someone can point me in the right direction.

I didn’t see anything in the ML guide or the underlying JavaScript code that 
suggested I’m missing some setup.

Thanks,

Eliot

--
Eliot Kimber
http://contrext.com
 



_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to