This is a migrated thread and some comments may be shown as answers.

Adjusting the x axis location when displaying negative valaues

1 Answer 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dheuv
Top achievements
Rank 1
Dheuv asked on 04 Sep 2020, 07:22 PM

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>

1 Answer, 1 is accepted

Sort by
0
Dheuv
Top achievements
Rank 1
answered on 04 Sep 2020, 07:28 PM
the axis axis crossing is defaulting to 0. 
Tags
General Discussions
Asked by
Dheuv
Top achievements
Rank 1
Answers by
Dheuv
Top achievements
Rank 1
Share this question
or