Add null check in GenericVisualization

This commit is contained in:
Himanshu DIxit 2021-02-24 12:37:53 +05:30
parent caeeec803e
commit 52b7d38df8
3 changed files with 3 additions and 3 deletions

View File

@ -18,6 +18,7 @@ const { Option } = Select;
const DateTimeWrapper = styled.div` const DateTimeWrapper = styled.div`
margin-top: 20px; margin-top: 20px;
justify-content: flex-end !important;
`; `;
interface DateTimeSelectorProps extends RouteComponentProps<any> { interface DateTimeSelectorProps extends RouteComponentProps<any> {

View File

@ -15,10 +15,10 @@ interface GenericVisualizationsProps {
const GenericVisualizations = (props: GenericVisualizationsProps) => { const GenericVisualizations = (props: GenericVisualizationsProps) => {
const data = { const data = {
labels: props.data !== undefined && props.data.map((s) => new Date(s.timestamp / 1000000)), labels: (props.data !== undefined && props.data !== null) && props.data.map((s) => new Date(s.timestamp / 1000000)),
datasets: [ datasets: [
{ {
data: props.data.map((s) => s.value), data: (props.data !== undefined && props.data !== null) && props.data.map((s) => s.value),
borderColor: "rgba(250,174,50,1)", // for line chart borderColor: "rgba(250,174,50,1)", // for line chart
backgroundColor: props.chartType === "bar" ? "rgba(250,174,50,1)" : "", // for bar chart, don't assign backgroundcolor if its not a bar chart, may be relevant for area graph though backgroundColor: props.chartType === "bar" ? "rgba(250,174,50,1)" : "", // for bar chart, don't assign backgroundcolor if its not a bar chart, may be relevant for area graph though
}, },

View File

@ -47,7 +47,6 @@ const _TraceFilter = (props: TraceFilterProps) => {
const urlParams = new URLSearchParams(location.search.split("?")[1]); const urlParams = new URLSearchParams(location.search.split("?")[1]);
useEffect(()=>{ useEffect(()=>{
console.log("Mera")
handleApplyFilterForm({ handleApplyFilterForm({
service: "", service: "",
tags: [], tags: [],