กรุณาแนะนำหากมีปัญหาในการทำความเข้าใจคำถาม เพื่อที่ฉันจะได้แก้ไขคำถามและให้ข้อมูลที่จำเป็นได้
ฉันต้องการแสดงเส้นและคำแนะนำเครื่องมือบนหลายแผนภูมิเมื่อฉันวางเมาส์เหนือแผนภูมิเดียว
ในแผนภูมิต่อไปนี้ ฉันสามารถรับเส้นบนแผนภูมิเดียว ฉันต้องการให้เส้นควรดำเนินต่อไปจนถึงแกน X และคำแนะนำเครื่องมือสำหรับค่าที่เน้นบนหลายแผนภูมิ
ต่อไปนี้คือ jsfiddle ที่ฉันใช้งานมาจนถึงตอนนี้
$(window).load(function () {
var textareas$ = $('#chartarea g');
textareas$.hide();
$('input[name="Air"]').change(function () {
var elem$ = $(this);
var correspelem$ = textareas$.eq(elem$.val() - 1);
if (elem$.val() == 1) {
select('Retail', "#Retail");
} else if (elem$.val() == 2) {
select("Gas", "#Gas");
} else if (elem$.val() == 3) {
select("Dining", "#Dining");
} else {};
if (elem$.is(':checked')) correspelem$.show();
else correspelem$.hide();
var lastSelectedChartIndex;
var chartAxis = document.querySelectorAll('#chartarea .axis.x');
var selectedCharts = document.querySelectorAll('#options input').forEach((elem, index) => {
if (elem.checked) {
lastSelectedChartIndex = index;
}
});
//console.log(lastSelectedChartIndex)
chartAxis
.forEach((elem, index) => (index !== chartAxis.length - 1) && !(index == lastSelectedChartIndex) ? elem.style.display = 'none' : elem.style.display = 'block')
});
});
setLinePosition
บนแผนภูมิของคุณ ซึ่งจะให้ค่าแก่แผนภูมิอื่นๆ ของคุณในการโทรกลับ จากนั้นสำหรับแต่ละแผนภูมิ ให้ตั้งค่าตำแหน่งของเส้นตามค่าที่ได้รับ - person Hugues Stefanski   schedule 15.08.2017