HighCharts aktualisiert Serien langsamJavaScript

Javascript-Forum
Anonymous
 HighCharts aktualisiert Serien langsam

Post by Anonymous »

Ich muss Bohrlöcher auf einer Horizontkarte und in einem vertikalen Abschnitt einzeichnen.
Ich habe keine Probleme mit den Karten, aber vertikale Abschnitte können unterschiedliche Richtungswinkel haben, also muss ich das Profil meines Bohrlochs darauf projizieren und es dauert einige Minuten für hundert Punkte.
Ich verwende drei Variablen für den Trajektorienpunkt jedes Bohrlochs: Ostwert, Nordwert und vertikale Tiefe.
Für die Karte ist alles sehr einfach: Ostwert ist X und der Nordwert ist Y:

Code: Select all

    var act_plan = [];

Zyklus's Zyklus.    for(...)
{
act_plan.push({x: upperX, y: upperY, name: "Inc=" + Inc + ", Azi=" + AzimAccepted + " @ " + MD});
}
...

Code: Select all

    if(act_plan.length > 0)
{
planChart.addSeries(
{
id: "act_plan",
color: "black",
name: "bla-bla-bla",
data: act_plan,
dashStyle: "Solid",
lineWidth: 2,
type: 'spline',
crisp: false
},
false, false
);
}
...

Code: Select all

    planChart.redraw(true);
Aber beim vertikalen Abschnitt mache ich wohl etwas falsch

Code: Select all

    var act_profileX = [];
Zyklus's Zyklus.
for(...)
{
act_profileX.push({x: calcShiftAway(upperX, upperY, 0), y: upperTVD, name: "Inc=" + Inc + ", Azi=" + AzimAccepted + " @ " + MD});
}

wo

Code: Select all

    function calcShiftAway(east, nord, VSrad)   // X,Y coordinates and a directional angle in radians of a vertical section
{
return (-nord*Math.cos(VSrad) + east*Math.sin(VSrad)); // rotate coordinates
}
...

Code: Select all

  if(act_profileX.length > 0)
{
var oPl = sectionChartWest.addSeries(
{
id: "act_plan", // the same id as for the plan
color: "black",
name: "bla-bla-bla",
data: act_profileX, //
dashStyle: "Solid",
lineWidth: 2,
type: 'spline',
crisp: false
},
false, false
);
oPl = rotateProfile("act_plan"); // I used var OPl to be sure that the series have been formed before the next manipulations with them (paranoia)
}
wo

Code: Select all

    function rotateProfile(data_id)
{
var oProfile = sectionChartWest.get(data_id);
var oPlan = planChart.get(data_id);

if(typeof(oProfile) === "undefined")
{
alert("There is no such a profile " + oProfile + " - it's a program Error");
return false;
}

if(typeof(oPlan) === "undefined")
{
alert("There is no such a plan " + oPlan + " - it's a program Error");
return false;
}

if(oProfile.data.length != oPlan.data.length || oProfile.data.length

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post