Are MarkLines broken on the phone? #102
-
I'm trying to create some markLines. This is just an example for my markLines but they do not work. I tried multiple versions of it couldn't create a single line. const skiaRef = useRef<any>(null);
useEffect(() => {
const option = {
grid: {
top: 30,
bottom: 30,
left: "5%",
},
tooltip: {
trigger: "item",
formatter: function (params) {
return params.dataIndex === 0
? `${rangeLow.format("DD")}-${rangeLow.add(firstWeek.length-1, "day").format("DD MMM")} \n ${params.value.toFixed(1)}%` //prettier-ignore
: params.dataIndex === 52
? `${rangeHigh.subtract(lastWeek.length-1, "day").format("DD")}-${rangeHigh.format("DD MMM")} \n ${params.value.toFixed(1)}%` //prettier-ignore
: `${newRangeLow.add(params.dataIndex-1, "week").format("DD")}-${newRangeLow.add(params.dataIndex-1,"week").add(6,'day').format("DD MMM")} \n ${params.value.toFixed(1)}%` //prettier-ignore
},
confine: true,
},
xAxis: [
{
type: "category",
data: Object.keys(resultObject),
show: false,
},
{
position: "bottom",
type: "category",
data: categories.map((category) => category.charAt(0)),
xAxisIndex: 2,
show: true,
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
],
yAxis: {
show: false,
type: "value",
},
series: [
{
data: Object.values(resultObject),
type: "bar",
itemStyle: {
color: (seriesIndex) =>
seriesIndex.dataIndex > 39 ? "#FF5630" : "#A19D9A",
},
markLine: {
data: [
// case A
{
yAxis: 50,
},
{
type: "average",
},
// case B
[
{
coord: [2, 40],
},
{
coord: [1, 300],
},
],
[
{
type: "min",
},
{
type: "max",
},
],
],
},
},
],
};
``` |
Beta Was this translation helpful? Give feedback.
Answered by
zhiqingchen
Aug 18, 2023
Replies: 2 comments 3 replies
-
Here is my stack overflow post for more information |
Beta Was this translation helpful? Give feedback.
0 replies
-
have you use MarkLineComponent?
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
zhiqingchen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have you use MarkLineComponent?