Adjusting the x axis location when displaying negative valaues

2 posts, 0 answers
  1. Dheuv
    Dheuv avatar
    2 posts
    Member since:
    Sep 2020

    Posted 04 Sep Link to this post

    Hey, I am using Angular, and when the chart loads up, the axis is at the correct location. I added axisCrossing values. 

     

      pressureAxisOptions: ValueAxis = {
        axisCrossingValue: Number.NEGATIVE_INFINITY,
        name: 'Pressure (psi)',
        min: -10,
      };
      extendedYAxisOptions: ValueAxis = {
        majorGridLines: {
          color: transparentBlack,
        },
        min: -10,
        axisCrossingValue: [Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY],
      };

    but after the user zooms in, the data is reloaded from the backend and the setting goes away. What am i doing wrong ?

     

     

     <kendo-chart-series>
          <!-- Loop thru all readings -->
          <kendo-chart-series-item *ngFor="let readings of pressureReadingsData" [data]="readings.items"
            [color]="seriesOptionsArr.get(readings.value).color" [markers]="{ visible: false }"
            [name]="seriesOptionsArr.get(readings.value).name" type="scatterLine" xField="timeRead" yField="sample"
            zIndex="1">
          </kendo-chart-series-item>
        </kendo-chart-series>
        <kendo-chart-x-axis>
          <kendo-chart-x-axis-item type="date" baseUnit="seconds" [labels]="{ format: getAxisDateFormat()}"
            [majorGridLines]="{ visible: false }"
            [minorGridLines]="{ visible: false }" 
            [min]="xAxisMin" 
            [max]="xAxisMax" 
            majorTicksVisible=false 
            name='date_axis'>
          </kendo-chart-x-axis-item>
        </kendo-chart-x-axis>
        <kendo-chart-y-axis>
          <kendo-chart-y-axis-item [name]="pressureAxisOptions.name" [min]="yAxisMin" [plotBands]="yPlotBands"
            [majorGridLines]="pressureAxisOptions.majorGridLines" [majorUnit]="pressureAxisOptions.majorUnit" 
            name='value_axis'>
          </kendo-chart-y-axis-item>
        </kendo-chart-y-axis>
        <kendo-chart-tooltip>
          <ng-template kendoChartSeriesTooltipTemplate let-value="value">
            <div class="card p-1">
              {{ value.x | localizedDate : 'DateTimeStandard' }} : {{ value.y }} psi
            </div>
          </ng-template>
        </kendo-chart-tooltip>
      </kendo-chart>

  2. Dheuv
    Dheuv avatar
    2 posts
    Member since:
    Sep 2020

    Posted 04 Sep in reply to Dheuv Link to this post

    the axis axis crossing is defaulting to 0. 
Back to Top