Advanced Cash Bids Chart Widget
Interactive chart for historic cash bids price and basis (current and 3-year average).
Example
                              window.dtn.cashBids.createAdvancedCashBidsChartWidget({
 
                                
});
                              
                            
                            
                          Types
Units
type Units = "Imperial" | "Metric";
                                      These are the available metric systems that widget support.
SiteId
type SiteId = string;
                                This type describe site id data that may be used to supply the siteId property.
CashBidId
type CashBidId = number;
                                This type describe cash bid id that may be used to supply the cashBidId property.
Configuration
apiKey
apiKey: string;
                                      The widget access api key associated with your DTN account.
container
container: HTMLElement | string;
                                      The container to mount the widget on. This can be a reference to an HTML element, or a valid selector string. If a string is encountered, document.querySelector will be used to search document for the container.
units
units?: Units = "Imperial";
                                      The measuring units that are used for presenting numbers in the weather forecast.
siteId
siteId: SiteId;
                                The Site Identifier used when setting up the account in Portal Publisher.
defaultCashBid
defaultCashBid?: { cashBidId: CashBidId; range?: string = "Y" } | { locationId?: number; commodityId?: number; range?: string= "Y" };
                                Object containing the identifier for a specific cash bid and an optional range or object with optional locationId, commodityId and range. Range is in format: Y=Year, D=Daily, W=Weekly, M=Monthly, X-M=X Months Intervals, where X represents a number of months. So 5-M represents 5 months intervals. Range must be greater than 1 day and less than 1 year. Default set to "Y".
showCurrentBasis
showCurrentBasis?: boolean = true;
                                Display the current basis price line. Default set to true.
show3YearAverageBasis
show3YearAverageBasis?: boolean = true;
                                Display the 3 year average basis price line if there is data for it. Default set to true.
show3YearAverageCashPrice
show3YearAverageCashPrice?: boolean = true;
                                Display the 3 year average cash price line if there is data for it. Default set to true.
Methods
setCashBid
setCashBid: (
     cashBid: 
       { cashBidId: CashBidId; range?: string = "Y" } | 
       { locationId?: number; commodityId?: number; range?: string= "Y" }
) => void;
                                Set the portal cash bid and load the widget with it.
Callbacks
onCashBidChange
onCashBidChange: (
     cashBid: { 
          locationId: number; 
          commodityId: number; 
          range: string; 
          deliveryEndDate: Date 
    }
);
                                This callback will be called whenever the chart is redraw. The callback takes a single argument which represents the new portal cash bid state.