Subversion Repositories SmartDukaan

Rev

Rev 33990 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33990 Rev 34388
Line 1... Line 1...
1
  <div class="chart-container" id="chart-container" style="position: relative; width:100%">
1
<div class="chart-container" id="chart-container" style="position: relative; width:100%">
2
                            <canvas id="barchart" width="auto" height="auto"></canvas>
2
    <canvas id="barchart" width="auto" height="auto"></canvas>
3
                        </div>
3
</div>
4
                        
-
 
5
                        
-
 
-
 
4
 
-
 
5
 
6
   <style>
6
<style>
7
   canvas {
7
    canvas {
8
        -moz-user-select: none;
8
        -moz-user-select: none;
9
        -webkit-user-select: none;
9
        -webkit-user-select: none;
10
        -ms-user-select: none;
10
        -ms-user-select: none;
11
    }
11
    }
12
</style>
12
</style>
13
                 
-
 
14
 <script type="text/javascript">
-
 
15
  
-
 
16
        var options = $chartMap;
-
 
17
        var ctx = document.getElementById('barchart').getContext('2d');
-
 
18
        window.bar = new Chart1(ctx, options);
-
 
19
   
-
 
20
</script>       
-
 
21
13
 
-
 
14
<script type="text/javascript">
-
 
15
 
-
 
16
    var options = $chartMap;
-
 
17
    var ctx = document.getElementById('barchart').getContext('2d');
-
 
18
    var myChart = new Chart1(ctx, options);
-
 
19
    var fofoId = `$fofoId`;
-
 
20
    var from = `$from`;
-
 
21
    var to = `$to`;
-
 
22
    var quantity_type = `$isQuantity`;
-
 
23
 
-
 
24
    console.log("FROM -", from)// 2025-03-01
-
 
25
    console.log("to -", to)//2025-03-25
-
 
26
 
-
 
27
    $("#chartForm").val(from);
-
 
28
    $("#chartTo").val(to);
-
 
29
    $("#quantity_type_id").val(quantity_type).trigger('change');
-
 
30
 
-
 
31
 
-
 
32
    document.getElementById('barchart').onclick = function (evt) {
-
 
33
        var activePoints = myChart.getElementsAtEvent(evt);
-
 
34
        if (activePoints.length > 0) {
-
 
35
            var dataIndex = activePoints[0]._index;  // Kaunsa bar click hua
-
 
36
            var brand = options.data.labels[dataIndex];  // Brand Name
-
 
37
 
-
 
38
            console.log("Clicked label(brand)-:", brand);
-
 
39
 
-
 
40
            // new bar chart for details veiw of specific brand's model wise
-
 
41
            makeModelWiseChart(brand, from, to, fofoId,quantity_type);
-
 
42
        }
-
 
43
    };
-
 
44
 
-
 
45
    function makeModelWiseChart(brandName, fromDate, toDate, partnerId,quantity_Type) {
-
 
46
          doGetAjaxRequestHandler(`${context}/brandWiseFofoSaleData?from=${fromDate}&to=${toDate}&brand=${brandName}&fofoId=${partnerId}&isQuantity=${quantity_Type}`,function (response) {
-
 
47
             $('.model_charbar_container').html(response);
-
 
48
         });
-
 
49
    }
-
 
50
</script>
-
 
51
22
52