'Line chart all data points at same point

All timestamps at same place on x-axis

''' getMyChart_OneHourdata(data) { data.forEach(el => { for (let key in el) { if (key == "dataset") this.lastOneHourDataValues = el[key]

        }})
  console.log("lastonehr",this.lastOneHourDataValues)
   
    for (const value of this.lastOneHourDataValues) {
        console.log(value)
       for(const val of value)
       {
           this.lastonehrtimestamp.push(val.x)
           this.lastonehrdatavalues.push(val.y)
       }

    };
    console.log(" this.lastonehrdatavalues", this.lastonehrdatavalues)
    console.log("this.lastonehrtimestamp", this.lastonehrtimestamp)
    const ctx = document.getElementById('SDSPOneChart');
        console.log("ctx", ctx)
    console.log("last1hrdata", data)
   
    const sdsPOneChart = new Chart(ctx, {
            type: 'line',
            data: {
                
                labels: [this.lastonehrtimestamp],
                datasets: [{
                    label: 'SDS_P1',
                    data: [this.lastonehrdatavalues],
                    backgroundColor: ['Orange'],
                    borderColor: 'rgb(75, 192, 192)',
                    tension: 0
                }],

            },

            options: {
                responsive: true,
                maintainAspectRatio: true,

                scales: {
                    x: {
                        beginAtZero: true
                     }
                }
            }
        });
    console.log("CurrentSDSP1_P2", sdsPOneChart)
    }

'''

Am i doing something wrong here. Do i need to configure x-axis?



Solution 1:[1]

You don't have any groups in your regex.

(?:...) is a non capture group, I guess you want

pattern = r'\b(' + ' (?:\w+ )?(?:\w+ )?'.join(markers) + r')\b'

Solution 2:[2]

This code can get the result what you want.I have tested.

import re
s = "hello a world today b is sunny c day"
pat = r'(a.*c)'
result = re.sub(pat,r'<b>\1</b>',s)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Toto
Solution 2