DIAdemのグラフに線や曲線を追加する

更新しました Apr 28, 2025

環境

ソフトウェア

  • DIAdem Full
  • DIAdem

この記事では、DIAdemのグラフに一定のY値でX軸に平行な定数線を表示する方法を紹介します。

以下の手順に従って、サンプルデータから手動でグラフを生成し、グラフに直線を追加します。

1. [REPORT]タブに移動し[新規レイアウト]をツールバーから選択し新規レポートを作成します
 


2.その後、レポートウィンドウにカーソルをドラッグし、2Dグラフのアイコン > 線をクリックして、2D軸システム(線あり)をクリックしレポート上にドラッグし追加します。

3.データポータルを展開し、グラフに表示するデータを選択します。この例では、DIAdemのサンプルデータからNoise_1を選択しました。このデータをステップ2で作成した2D軸システムにドラッグします。
 
4. 線または曲線を追加するには、 2D軸システムをダブルクリックします。

5. [新規作成]を選択します。
 

6. 定数線を生成するには、左側のメニューから[定数]を選択し、[Y-constant]のフィールドに指定の値を入力します。2D軸システムのグラフに戻るまで[OK]をクリックします。

 

8.これで、グラフに定数線が表示されます。




    以下のコードを実行すると、サンプルデータからプログラムでグラフを生成し、グラフに定数線を追加します。

    'This section of the code creates the Plot
    Dim oMy2DAxisSystem, oMyPos, oMy2DCurve, oMy2DConstY,oMy2DConstX
    Call Report.NewLayout()
    Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
    Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate
    oMyPos.X1 = 20
    oMyPos.X2 = 80
    oMyPos.Y1 = 20
    oMyPos.Y2 = 80
    Set oMy2DCurve = oMy2DaxisSystem.Curves2D.Add(e2DShapeLine, "MyNew2DCurve")
    oMy2DCurve.Shape.XChannel.Reference = "EXAMPLE/Time"
    oMy2DCurve.Shape.YChannel.Reference = "EXAMPLE/Speed" 
    Call Report.Refresh()

     

    'This section of the code creates a new constant curve, which is parallel with the X axis
    Set oMy2DConstY = oMy2DaxisSystem.Curves2D.Add(e2DShapeConstant, "MyNew2DConstantY")
    oMy2DConstY.Shape.XConstant.Reference = NOVALUE
    oMy2DConstY.Shape.YConstant.Reference = 32
    Call oMy2DConstY.Shape.Settings.Line.Color.SetPredefinedColor(eColorIndexGreen)
    Call Report.Refresh()

     

    'This section of the code creates a new constant curve, which is parallel with the Y axis
    Set oMy2DConstX = oMy2DaxisSystem.Curves2D.Add(e2DShapeConstant, "MyNew2DConstantX")
    oMy2DConstX.Shape.XConstant.Reference = 30
    oMy2DConstX.Shape.YConstant.Reference = NOVALUE
    Call oMy2DConstX.Shape.Settings.Line.Color.SetPredefinedColor(eColorIndexRed)
    Call Report.Refresh()

      上記のコードを実行すると、DIAdemレポートに次のグラフが表示されます。