You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/10/19 08:44:35 UTC
[GitHub] [echarts] Tudor16c opened a new issue, #17789: [Bug] Samplin Threshold not working
Tudor16c opened a new issue, #17789:
URL: https://github.com/apache/echarts/issues/17789
### Version
5.4.0
### Link to Minimal Reproduction
_No response_
### Steps to Reproduce
```
{
yAxisIndex: 0,
sampling: 'lttb',
large: true,
largeThreshold: 100,
name: 'Pressure In',
type: 'line',
smooth: true,
symbol: 'none',
encode: {
x: 'Time',
y: 'Bar',
itemName: 'Time',
tooltip: ['Bar']
},
data: pressureIn
},
```
### Current Behavior
I want to lower the threshold of the chart like in this chart https://www.base.is/flot/ using sampling, large and largeThreshold which I assume that those are the methods that I need for doing that, but it does not have any influence over my code.
### Expected Behavior
I expect the lines to be much more smooth when using sampling, from this

I want it to be something like this

### Environment
```markdown
- OS: MacOS
- Browser:Chrome
- Framework: React
```
### Any additional comments?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Sampling Threshold not working [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #17789: [Bug] Sampling Threshold not working
URL: https://github.com/apache/echarts/issues/17789
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] Tudor16c commented on issue #17789: [Bug] Sampling Threshold not working
Posted by GitBox <gi...@apache.org>.
Tudor16c commented on issue #17789:
URL: https://github.com/apache/echarts/issues/17789#issuecomment-1286584305
` var series = [
{
yAxisIndex: 0,
sampling: 'lttb',
name: 'Pressure In',
type: 'line',
smooth: true,
symbol: 'none',
encode: {
x: 'Time',
y: 'Bar',
itemName: 'Time',
tooltip: ['Bar']
},
data: pressureIn,
large: true,
largeThreshold: 100,
},
{
yAxisIndex: 1,
sampling: 'lttb',
name: 'Temperature Water',
type: 'line',
smooth: true,
symbol: 'none',
encode: {
x: 'Time',
y: '°C',
itemName: 'Time',
tooltip: ['°C']
},
data: temperatureWater,
large: true,
largeThreshold: 100,
},
]
const option = {
legend: {
show: true
},
tooltip: {
trigger: 'axis',
position: function (pt)
{
return [pt[0] + 50, '10%'];
},
axisPointer: {
type: 'cross'
},
formatter: (params) =>
{
var xTime = new Date(params[0].axisValue)
let tooltip = `<p>${xTime.toLocaleString()}</p> `;
series.forEach((serie, index) =>
{
let serieData = serie.data.find((data) =>
{
return data[0] == params[0].axisValue
})
tooltip += `<p><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color: ${chart.getVisual({ seriesIndex: index }, 'color')}"></span>`
});
return tooltip;
}
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: 'none',
},
restore: {},
saveAsImage: {
show: true,
type: 'png',
name: props?.widget?.Machine?.name + '-' + props?.date
}
}
},
xAxis: {
type: 'time',
boundaryGap: false
},
yAxis: [
{
type: 'value',
name: 'Pressure',
alignTicks: true,
axisLabel: {
formatter: '{value} Bar'
},
axisLine: {
show: true,
lineStyle: {
color: '#91CC75'
}
},
},
{
type: 'value',
name: 'Temperature',
alignTicks: true,
axisLabel: {
formatter: '{value} °C'
},
axisLine: {
show: true,
lineStyle: {
color: '#5470C6'
}
},
},
],
dataZoom: [
{
type: 'inside',
start: 0,
end: 100
},
{
start: 0,
end: 100
}
],
series: series
};
return (
<ReactECharts option={option}
onChartReady={(chart) =>
{
setChart(chart);
}}
showLoading={loading}
/>
)
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Sampling Threshold not working [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17789:
URL: https://github.com/apache/echarts/issues/17789#issuecomment-3708425268
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Sampling Threshold not working [echarts]
Posted by "janvorwerk (via GitHub)" <gi...@apache.org>.
janvorwerk commented on issue #17789:
URL: https://github.com/apache/echarts/issues/17789#issuecomment-1878882245
It seems to me that following settings are only applicable to the `lines` charts, not the `line` (no s) chart that you are using.
```js
large: true,
largeThreshold: 100,
```
If you look at the [code for sampling](https://github.com/apache/echarts/blob/9d61cbcb93c68156e307a89035a7b16da1a8c73b/src/processor/dataSample.ts#L112C49-L112C53), the sampling just takes the number of points in the dataset and tries to downsample it to the number of pixels on the plot (only taking the device pixel ratio into account).
See #15437 for what I believe you are trying to achieve.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] strangeiot commented on issue #17789: [Bug] Sampling Threshold not working
Posted by GitBox <gi...@apache.org>.
strangeiot commented on issue #17789:
URL: https://github.com/apache/echarts/issues/17789#issuecomment-1284078276
@Tudor16c
Could you please attach your code snapshot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Sampling Threshold not working [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17789:
URL: https://github.com/apache/echarts/issues/17789#issuecomment-3735831732
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org