jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts

  • shawn
    Participant

    well I got this to work. I’m not sure what I did to make it work though.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Culture Summary by Submission</title>
    	  <meta name="description" content="Culture Summary by Submission">	
    		
        <link rel="stylesheet" href="../jqx/styles/jqx.base.css" type="text/css" />
        <link rel="stylesheet" href="../css/culture3.css" type="text/css" />
        
    	  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>    
        <script src="../jqx/jqxcore.js"></script>
        <script src="../jqx/jqxdata.js"></script>
        <script src="../jqx/jqxdraw.js"></script>
        <script src="../jqx/jqxchart.core.js"></script>
        
        <script>
            $(document).ready(function () {
                // prepare chart data as an array
                var chartData = [
                        { week: 'wk1', 'No Growth': 30, '1-10': 0, '11-100': 25 },
                        { week: 'wk2', 'No Growth': 25, '1-10': 25, '11-100': 0 },
                        { week: 'wk3', 'No Growth': 30, '1-10': 0, '11-100': 25 },
                        { week: 'wk4', 'No Growth': 35, '1-10': 25, '11-100': 45 },
                        { week: 'wk5', 'No Growth': 0, '1-10': 20, '11-100': 25 },
                        { week: 'wk6', 'No Growth': 30, '1-10': 0, '11-100': 30 }                    
                    ];
                // prepare jqxChart settings
                var settings = {
                    title: "//clientSpan",
                    description: "//dateSpan",
                    enableAnimations: true,
                    showLegend: true,
                    legendLayout : { left: 750, top: 10, width: 500, height: 200, flow: 'vertical' },
                    padding: { left: 5, top: 5, right: 5, bottom: 5 },
                    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
                    source: chartData,
                    xAxis:
                    {
                        dataField: 'week',
                        tickMarks: {
                            visible: true,
                            interval: 1,
                            color: '#BCBCBC'
                        },
                        gridLines: {
                            visible: true,
                            interval: 1,
                            color: '#BCBCBC'
                        },
                        axisSize: 'auto'
                    },
                    valueAxis:
                    {
                        unitInterval: 10,
                        title: {text: 'Number of Samples'},
                        tickMarks: {color: '#BCBCBC'},
                        gridLines: {color: '#BCBCBC'},
                        labels: {
                            horizontalAlignment: 'right'
                        },
                    },
                    colorScheme: 'scheme04',
                    seriesGroups:
                        [
                            {
                                type: 'stackedcolumn',
                                columnsGapPercent: 100,
                                seriesGapPercent: 5,
                                series: [
                                        { dataField: 'No Growth', displayText: 'No Growth' },
                                        { dataField: '1-10', displayText: '1-10' },
                                        { dataField: '11-100', displayText: '11-100' },
                                        { dataField: '100-1001', displayText: '100-1001' },
                                        { dataField: '1001-10000', displayText: '1001-10000' },
                                        { dataField: 'TNTC', displayText: 'TNTC' }
                                    ]
                            }
                        ]
                };
                // setup the chart
                $('#chartContainer').jqxChart(settings);
                
    				    // add a new color scheme named 'kuster'
    				    $('#chartContainer').jqxChart('addColorScheme', 'kuster', ['#00C000', '#80FF80', '#FFFF40','#F8902C', '#FF8080', '#FF0000']);
    				    // apply the new scheme by setting the chart's colorScheme property
    				    $('#chartContainer').jqxChart('colorScheme', 'kuster');
    				    // refresh the chart
    				    $('#chartContainer').jqxChart('refresh');            
            });
        </script>
    </head>
    <body>
    	<div id="wrapper">
    
    			<div id="header" >
    				<!-- insert company  header -->
    			</div>	
    
    			<div id="chartContainer" style="width:850px; height:500px;">
    			</div>	
    
    			<div class='noPrint' id='bPrint'>
    			<button style='font-size:8pt' onclick="printThis();">print this page</button><br>
    			For your protection, this link will expire in 7 days.
    			</div>	
    	
    	</div>
    </body>
    </html>

    shawn
    Participant

    I’ve made some changes, but still no chart

    <!doctype html>
    <html lang="en">
    <head>
    	<meta charset="utf-8">
    	<title>Culture Summary</title>
    	<meta name="description" content="Culture Summary">
    	<meta name="author" content="Shawn Anderson">
    
    	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    	
    	<link rel="stylesheet" href="../jqx/styles/jqx.base.css" type="text/css" />
    	<link rel="stylesheet" href="../css/culture3.css?v=1.0">
    
    </head>
    <body>
    	
    	<div id="wrapper">
    
    			<div id="header" >
    				<!-- insert company  header -->
    			</div>	
    
    			<div id="graphWrapper">
    
    			</div>	
    	
    
    			<div class='noPrint' id='bPrint'>
    			<button style='font-size:8pt' onclick="printThis();">print this page</button><br>
    			For your protection, this link will expire in 7 days.
    			</div>	
    	
    	</div>
    
    <script src="../jqx/jqxcore.js"></script>
    <script src="../jqx/jqxdraw.js"></script>
    <script src="../jqx/jqxchart.core.js"></script>
    <script src="../jqx/jqxdata.js"></script>
    
    	
    <script>
    	// print page function
    	function printThis(){
    		
    		
    	};
    	
    	$(document).ready(function () {
                // prepare chart data as an array
                var chartData = [
                        { week: 'wk1', 'No Growth': 30, '1-10': 0, '11-100': 25 },
                        { week: 'wk2', 'No Growth': 25, '1-10': 25, '11-100': 0 },
                        { week: 'wk3', 'No Growth': 30, '1-10': 0, '11-100': 25 },
                        { week: 'wk4', 'No Growth': 35, '1-10': 25, '11-100': 45 },
                        { week: 'wk5', 'No Growth': 0, '1-10': 20, '11-100': 25 },
                        { week: 'wk6', 'No Growth': 30, '1-10': 0, '11-100': 30 }                    
                    ];
                // prepare jqxChart settings
                var settings = {
                    title: "//clientSpan",
                    description: "Culture Summary by Submission",
                    enableAnimations: true,
                    showLegend: true,
                    padding: { left: 5, top: 5, right: 5, bottom: 5 },
                    titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
                    source: chartData,
                    xAxis:
                    {
                        dataField: 'week',
                        tickMarks: {
                            visible: true,
                            interval: 1,
                            color: '#BCBCBC'
                        },
                        gridLines: {
                            visible: true,
                            interval: 1,
                            color: '#BCBCBC'
                        },
                        axisSize: 'auto'
                    },
                    valueAxis:
                    {
                        unitInterval: 1,
                        title: {text: 'Number of Samples'},
                        tickMarks: {color: '#BCBCBC'},
                        gridLines: {color: '#BCBCBC'},
                        labels: {
                            horizontalAlignment: 'right'
                        },
                    },
                    colorScheme: 'scheme04',
                    seriesGroups:
                        [
                            {
                                type: 'stackedcolumn100',
                                columnsGapPercent: 100,
                                seriesGapPercent: 5,
                                series: [
                                        { dataField: 'No Growth', displayText: 'No Growth' },
                                        { dataField: '1-10', displayText: '1-10' },
                                        { dataField: '11-100', displayText: '11-100' }
                                    ]
                            }
                        ]
                };
                // setup the chart
                $('#graphWrapper').jqxChart(settings);
            });
      </script>
    
    </body>
    </html>
    

    shawn
    Participant

    I got it figured out.
    I was calling the init function every time I wanted to see the jqxWindow.
    What I needed to do was init the jqxWindow once, then call the open and close methods to use it.

    thanks for your help


    shawn
    Participant

    one other thing I’d like to do: If the value of the cell ‘linkORfile’ changes, I want to change the editable state of ‘linkHref’ as well.

    How?

    in reply to: can't always click checkbox can't always click checkbox #82492

    shawn
    Participant

    I updated to the latest version and that fixed the problem.
    Thanks

    in reply to: can't always click checkbox can't always click checkbox #82451

    shawn
    Participant

    here is a video of what I see happening


    shawn
    Participant

    I see the problem.
    I had no style for size set to the #chartContainer

    in reply to: simple json parse simple json parse #79622

    shawn
    Participant

    well, I got it to work by preparing the data in this way

                var source =
                {
                    datatype: "json",
                    datafields: [
                        { name: 'uName', type: 'string' },
                        { name: 'rqDate', type: 'string' },
                        { name: 'ipAddr', type: 'string' },
                        { name: 'programName', type: 'string' }                    
                    ],
                    root: "aMatch",
                    url: url
                };
    in reply to: simple json parse simple json parse #79621

    shawn
    Participant

    also, I am initializing like this:

    
                $("#jqxgrid").jqxGrid(
                {
                    width: 800,
                    source: dataAdapter,                
                    pageable: true,
                    autoheight: true,
                    sortable: true,
                    altrows: true,
                    enabletooltips: true,
                    editable: true,
                    selectionmode: 'multiplecellsadvanced',
                    columns: [
                      { text: 'User',datafield:'uName'},
                      { text: 'Request Date',datafield:'rqDate' },
                      { text: 'IP Address',datafield:'ipAddr'},
                      { text: 'Program Name',datafield:'programName'}                  
                    ]
                });

    shawn
    Participant

    perfect, thank you


    shawn
    Participant

    I’d like to add that the lines are a percentage above or below the baseline.
    So, say I set my baseline in this chart to $225,000.
    Green lines would show +/- 10% beyond the baseline.
    Red lines would we be 20% +/-.

    I’m wondering if the “draw” functions are what I need.


    shawn
    Participant

    that was it! I changed “stacked line” to “line” and it’s perfect.
    Thanks again!


    shawn
    Participant

    … I see that it is adding the values together, so I suspect I’m using the wrong type of chart.


    shawn
    Participant

    thank looks much better! Thank you.
    I have one more question.
    The plotted points on the chart do not seem to correspond to the data values from the json.
    For instance, the “count” from the data is 25, but it is plotted at 36.
    What am I doing wrong? thanks

    example

    in reply to: add a button to grid add a button to grid #73470

    shawn
    Participant

    thank you

Viewing 15 posts - 16 through 30 (of 30 total)