Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCSPCChart SPC for Java
 SPC Chart in web application
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ajaypowral

USA
21 Posts

Posted - 21 Aug 2015 :  17:08:56  Show Profile  Reply with Quote
Hi, I am testing SPC Chart control (JavaScript) in my web application. I have some questions -
- How do I render chart in a specific div or iframe
- Is it possible to render multiple chart in same web page
- Is there any example of .Net code or API which I can use to convert my datatable into JSON String required by the chart

Thanks for the response.

Regards
Ajay

quinncurtis

1551 Posts

Posted - 22 Aug 2015 :  16:23:21  Show Profile  Reply with Quote
How do I render chart in a specific div or iframe ?
Adding the chart to an specific html div block is not part of the standard package at this time. We did however add it for a client. Should you purchase the software we can provide you with that. If you want to use it within an iframe, just create an HTML page with nothing but the base QCSPCChart in it. Then reference that html page in an iframe in your master html page.

Is it possible to render multiple chart in same web page ?
One of out standard SPC Charts can have up to 4 graphs in them: the Primary Chart (XBar for example), Secondary Chart (Range) and a Histogram chart for each. But that is all that you get. You can't add more than one of the 4-graph SPC Charts to a single page. The exception to that is if you place each SPC Chart in its own HTML page, and then include each charts HTML page in your own master HTML page using iframe.

Is there any example of .Net code or API which I can use to convert my datatable into JSON String required by the chart ?
We don't have any examples other than what's in the manual under sectin Dynamic Creation of JSON (Chapter 1), and the examples found under the Javascript, jQuery, Ajax and PHP section of Chapter 20. You can always hire us to do a custom example for your exact situation.
Go to Top of Page

ajaypowral

USA
21 Posts

Posted - 25 Jul 2016 :  10:28:38  Show Profile  Reply with Quote
Hello, I am opening this topic again,

How do I render chart in a specific div or iframe ?
Adding the chart to an specific html div block is not part of the standard package at this time. We did however add it for a client. Should you purchase the software we can provide you with that. If you want to use it within an iframe, just create an HTML page with nothing but the base QCSPCChart in it. Then reference that html page in an iframe in your master html page.

Referring to your response (listed above), I am working with Schneider-Electric, USA to implement SPC Chart for a client. As you mentioned above you can help us in rendering chart in a specific iFrame on an existing HTML page if we purchase the software. So, we have purchased it now, and would need your help in implementing this requirement.

Go to Top of Page

quinncurtis

1551 Posts

Posted - 25 Jul 2016 :  11:33:50  Show Profile  Reply with Quote
The added JNSI method, which should be present in what you have, is pushJSONChartCreateDiv with a prototype of

public void pushJSONChartCreateDiv(String jsonstring, String domelement)

Assuming you have a div defined somewhere in the web page with a ID of contentContainer:

<div id="contentContainer">
</div>

You can force the chart into the div using pushJSONChartCreateDiv

function processClick( )
{

var s = JSON.stringify(TimeXBarR,undefined,2);

<!-- pushDisplayJSONScript(s); -->

pushJSONChartCreateDiv(s, "contentContainer");

}

You cannot have multiple div and place a chart in each. There is still the restriction of one chart per HTML page.
Go to Top of Page

ajaypowral

USA
21 Posts

Posted - 26 Jul 2016 :  09:32:15  Show Profile  Reply with Quote
thanks for your response. To test pushJSONChartCreateDiv function, I modified spcsimple.html page as follows -
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="QCSPCChartGWT.css">
<script src="chartdefSimple.js"></script>
<script>
function CreateDivChart( )
{
var s = JSON.stringify(TimeXBarR,undefined,2);
pushJSONChartCreateDiv(s, "cc");

}
</script>
<script type="text/javascript" language="javascript" src="qcspcchartgwt/qcspcchartgwt.nocache.js"></script>
</head>
<body>
This is a test page.
<INPUT TYPE="button" NAME="displayChart" VALUE="Display Chart " CreateDivChart();">
<div id="cc"></div>
</body>
</html>

But it doesn't render chart. I also tried iFrame (not sure if that works) instead of Div but it doesn't work either.
Go to Top of Page

quinncurtis

1551 Posts

Posted - 26 Jul 2016 :  12:04:02  Show Profile  Reply with Quote
Your code for the HTML button is wrong. It should look like:

<INPUT TYPE="button" NAME="displayChart" VALUE="Display Chart" onClick="CreateDivChart();">

Because it was wrong, the CreateDivChart method was never assigned to the onClick event, and therefore never called. You can identify these types of errors by using a debugger on the code in your HTML page.


<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="QCSPCChartGWT.css">
<script src="chartdefSimple.js"></script>
<script>
function CreateDivChart( )
{
var s = JSON.stringify(TimeXBarR,undefined,2);
pushJSONChartCreateDiv(s, "cc");

}
</script>
<script type="text/javascript" language="javascript" src="qcspcchartgwt/qcspcchartgwt.nocache.js"></script>
</head>
<body>

This is a test page.
<INPUT TYPE="button" NAME="displayChart" VALUE="Display Chart" onClick="CreateDivChart();">

<div id="cc"></div>
</body>
</html>
Go to Top of Page

ajaypowral

USA
21 Posts

Posted - 26 Jul 2016 :  12:48:28  Show Profile  Reply with Quote
thanks, my apologies I didn't notice that. Thank you, it works fine.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07