Как добавить цветные точки с белой рамкой тени в chart.js? - PullRequest
0 голосов
/ 26 сентября 2018

пытается добавить цветные точки с белой теневой рамкой в ​​React chart.js Версия: 2.7.2, но безуспешно, пожалуйста, помогите.

что у меня сейчас

enter image description here

мой код:

   <div  style={{height: '200px', width: '400px', position: 'relative'}} className={'line-chart'}>


                <Line data={{
                    labels: ["May 09", "May 15", "May 29", "Jun 03"],
                    datasets: [{
                        data: [
                            {
                                x: "May 09",
                                y: 80,
                            },
                            {
                                x: "May 15",
                                y: 98
                            },
                            {
                                x: "May 29",
                                y: 90
                            },
                            {
                                x: "Jun 03",
                                y: 110
                            },
                        ],
                        pointBackgroundColor: ["#f7aa2e", "#05b9af", "#ee734e", "#ee734e"],
                        pointBorderColor: 'rgba(0,0,0,.2)',
                        pointBorderWidth: 3,
                        pointRadius: 4,
                        pointHoverRadius: 5,
                        lineTension: 0,
                        borderWidth: 1,
                        fill: false,
                    }]
                }}
                      options={{
                          legend: {
                              display: false
                          },
                          responsive: true,
                          // maintainAspectRatio: false,
                          scales: {
                              yAxes: [{
                                  display: false
                              }],
                              xAxes: [{
                                  type: 'category',
                                  gridLines: {
                                      display: false
                                  }
                              }]
                          },
                          tooltips: {
                              enabled: false,
                          }

                      }}
                />

            </div>

что я пытаюсь сделать

enter image description here

этот график с chart.js Версия: 2.6.0 отличается ли график css между этими двумя версиями?

1 Ответ

0 голосов
/ 26 сентября 2018

Если вы просто хотите удалить границу из точки, вы добавляете pointBorderWidth: 0, и просто удаляете pointBorderColor: 'rgba(0,0,0,.2)',

...