Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues getting chart to Display with JSF #19

Open
thombergs opened this issue Apr 21, 2014 · 1 comment
Open

Issues getting chart to Display with JSF #19

thombergs opened this issue Apr 21, 2014 · 1 comment

Comments

@thombergs
Copy link
Member

Reported by keith.priddy, Sep 12, 2013
I am having problems getting a chart to display when run through JSF. It is always set as a 0px X 0px element when I go through the debug. I have tried setting Height and Width manually through ChartOptions in the Java code or in the html (just creates an empty space). No errors with missing jars or dependencies, just no chart shown! This is the index.xhtml content:

<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:wc="http://googlecode.com/wickedcharts">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script src="http://code.highcharts.com/stock/highstock.js"></script>
    <script src="http://code.highcharts.com/stock/modules/exporting.js"></script>

    <body>
        <wc:chart id="chart1" options="#{QuickChart.options}" theme="#{QuickChart.theme}"/>
    </body>
        <div id="container" style="width:100%; height:400px;"></div>
... the Javascript chart function is here, but not relevant....

The bean info:

@ManagedBean(name="QuickChart")
@SessionScoped
public class QuickChart{
    Options options;
    private Theme theme = null;

    public QuickChart() {
     options = new Options();

     ChartOptions cOptions = new ChartOptions();
     cOptions.setType(SeriesType.LINE);
     cOptions.setHeight(400);
     cOptions.setWidth(400);


     options.setChartOptions(cOptions);
... 

the rest is copied from the "Getting Started" options page.

Running on Windows 7 with Chrome browser.
Deployed through Netbeans 7.3.1 with Glassfish and JSF 2.1.

Libraries:
Java EE Web 6
jackson-annotations-2.0.5
jackson-core-2.0.5
jackson-databind-2.0.5
wicked-charts-highcharts-1.5.0
wicked-charts-jsf21-1.5.0

@thombergs
Copy link
Member Author

#1 keith.priddy
Found one additional piece of data that makes me suspect it might be a related issue to #23.

In the Chrome Developers Console tab, this error shows up:
Uncaught Highcharts error #13: www.highcharts.com/errors/13

Which is:
Highcharts Error #13

Rendering div not found

This error occurs if the chart.renderTo option is misconfugured so that Highcharts is unable to find the HTML element to render the chart in.


I assume the element is supposed to be "chart1" in my code, but is not being reference correctly in the JSF wrapper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants